Nexus -library of custom gadgets (32-bit / 64-bit)
nxPropertyBox and nxSplitter controls.
These controls have both undergone a quite major update (Purebasic 4.3 version). In the case of the nxPropertyBox control, the alterations will break all existing code (my apologies), though any modifications required by applications will be very straight forward.
nxPropertyBox.
It is now possible to add items which do not belong to any 'group'. To do this the nx_AddGadgetItem() function has been changed for this control.
The 'imageID' parameter now points to the new item's nxPropertyBox_Item structure (not the 'flags' parameter) whilst the 'flags' parameter is to hold a non-zero value if the new item is to belong to the 'current' group (if there is one). See the demo programs for examples of how to employ these alterations.
Note that I have not automatically indented 'child' items for various reasons; not the least of which is the fact that some property boxes might allow the labels to be edited etc. and this would then require a quite major update to EsGRID which I do not have time for right now. Instead, you can simply pad child items label text with spaces if appropriate.
nxSplitter.
Have made alterations to extend the functionality of this control. You can now take steps to embed multiple controls directly within a nxSplitter without having to embed them first within a container gadget etc. This is because the control no longer complains if one of the two 'split' controls is omitted and also due to the fact that the #nxSplitter_GadgetsResized callback message is far more 'refined'. (See the nxGadgets_Residents.pbi source file for details).
There is also a new callback message : #nxSplitter_CustomPaint for those applications wishing to paint directly to the splitter control etc. (advanced users only).
Regards.
These controls have both undergone a quite major update (Purebasic 4.3 version). In the case of the nxPropertyBox control, the alterations will break all existing code (my apologies), though any modifications required by applications will be very straight forward.
nxPropertyBox.
It is now possible to add items which do not belong to any 'group'. To do this the nx_AddGadgetItem() function has been changed for this control.
The 'imageID' parameter now points to the new item's nxPropertyBox_Item structure (not the 'flags' parameter) whilst the 'flags' parameter is to hold a non-zero value if the new item is to belong to the 'current' group (if there is one). See the demo programs for examples of how to employ these alterations.
Note that I have not automatically indented 'child' items for various reasons; not the least of which is the fact that some property boxes might allow the labels to be edited etc. and this would then require a quite major update to EsGRID which I do not have time for right now. Instead, you can simply pad child items label text with spaces if appropriate.
nxSplitter.
Have made alterations to extend the functionality of this control. You can now take steps to embed multiple controls directly within a nxSplitter without having to embed them first within a container gadget etc. This is because the control no longer complains if one of the two 'split' controls is omitted and also due to the fact that the #nxSplitter_GadgetsResized callback message is far more 'refined'. (See the nxGadgets_Residents.pbi source file for details).
There is also a new callback message : #nxSplitter_CustomPaint for those applications wishing to paint directly to the splitter control etc. (advanced users only).
Regards.
I may look like a mule, but I'm not a complete ass.
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
I've just downloaded the ProGUI lib and there is a slight different in his residents to yours...
#I_IMAGENONE = $FFFFFFFFFFFFFFFE
vs.
#I_IMAGENONE = $FFFFFFFE
I know you both mean -2, but which one should win?
#I_IMAGENONE = $FFFFFFFFFFFFFFFE
vs.
#I_IMAGENONE = $FFFFFFFE
I know you both mean -2, but which one should win?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Oops! sorry your right - it was the toolbar. Thanks for confirming -2 is ok.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
28th July 2009 - nxPropertyBox controls.
This update fixes quite a number of bugs with the nxPropertyBox control following my work upon the Pyrex report designer. I can finally say that the damn thing is now working like a property box control should!
The main problems were related to the notifications sent by the control to the developer's callback as the user altered properties etc.
Regards.
This update fixes quite a number of bugs with the nxPropertyBox control following my work upon the Pyrex report designer. I can finally say that the damn thing is now working like a property box control should!

The main problems were related to the notifications sent by the control to the developer's callback as the user altered properties etc.
Regards.
I may look like a mule, but I'm not a complete ass.
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Thanks for the update. 

https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Re: Nexus -library of custom gadgets (updated : 28/7/09)
Just doing some major updates to ElementaryReports, so I thought I'd share some routines I use to manipulate various splitters for alternative views and to reduce 'initial' flicker caused by setting control positions...
The last example shows usage. Hope you find them useful. 
Code: Select all
;The following swaps the specified splitter
Procedure nxSplitter_Swap(id,refresh=#True)
Protected hWnd, *nx._nxsplitter
;Check we have a valid splitter control, signified by the presence of the window property.
If IsGadget(id)
hWnd = GadgetID(id)
*nx = GetProp_(hWnd, @"nxSPLITTER_PROP")
If *nx ;A valid splitter control.
temp=*nx\gad1
*nx\gad1=*nx\gad2
*nx\gad2=temp
If refresh
nxSplitter_PositionGadgets(*nx)
EndIf
EndIf
EndIf
EndProcedure
;The following exchanges the specified splitter gadget's first split
Procedure nxSplitter_Exchange(id,id2,refresh=#True)
Protected hWnd, *nx._nxsplitter, hWnd2, *nx2._nxsplitter
;Check we have a valid splitter control, signified by the presence of the window property.
If IsGadget(id) And IsGadget(id2)
hWnd = GadgetID(id)
hWnd2 = GadgetID(id2)
*nx = GetProp_(hWnd, @"nxSPLITTER_PROP")
*nx2 = GetProp_(hWnd2, @"nxSPLITTER_PROP")
If *nx And *nx2 ; both valid splitter control.
SetParent_(GadgetID(*nx\gad1),hWnd2)
SetParent_(GadgetID(*nx2\gad1),hWnd)
temp=*nx\gad1
*nx\gad1=*nx2\gad1
*nx2\gad1=temp
If refresh
nxSplitter_PositionGadgets(*nx)
nxSplitter_PositionGadgets(*nx2)
EndIf
EndIf
EndIf
EndProcedure
;The following directly sets the splitter state
Procedure nxSplitter_SetPos(id,state,refresh=#True)
Protected hWnd, *nx._nxsplitter
;Check we have a valid splitter control, signified by the presence of the window property.
If IsGadget(id)
hWnd = GadgetID(id)
*nx = GetProp_(hWnd, @"nxSPLITTER_PROP")
If *nx ;A valid splitter control.
*nx\splitterPos = state
If refresh
nxSplitter_PositionGadgets(*nx)
EndIf
EndIf
EndIf
EndProcedure
Procedure RefreshView(mode)
Select mode
Case 0 ; Split
If nx_GetGadgetAttribute(#MiddleSplitter,#nxSplitter_FirstGadget)<>#TopSplitter
nxSplitter_Swap(#MiddleSplitter,#False)
EndIf
If nx_GetGadgetAttribute(#TopSplitter,#nxSplitter_FirstGadget)=#StudentContainer
nxSplitter_Exchange(#TopSplitter,#BottomSplitter,#False)
nxSplitter_Swap(#TopSplitter,#False)
EndIf
nxSplitter_SetPos(#MiddleSplitter,MiddleBorderPosition,#False)
nx_SetGadgetState(#MiddleSplitter,#nxSplitter_AnchorSecondGadget)
nx_SetGadgetState(#BottomSplitter,StudentListWidth)
nx_SetGadgetState(#TopSplitter,MiddleHorizontalPosition)
Case 1 ; Multi
If nx_GetGadgetAttribute(#MiddleSplitter,#nxSplitter_FirstGadget)<>#BottomSplitter
nxSplitter_Swap(#MiddleSplitter,#False)
EndIf
If nx_GetGadgetAttribute(#TopSplitter,#nxSplitter_FirstGadget)<>#StudentContainer
nxSplitter_Swap(#TopSplitter,#False)
nxSplitter_Exchange(#TopSplitter,#BottomSplitter,#False)
EndIf
nx_SetGadgetState(#MiddleSplitter,MiddleBorderPosition)
nxSplitter_SetPos(#TopSplitter,StudentListWidth,#False)
nx_SetGadgetState(#TopSplitter,#nxSplitter_AnchorFirstGadget)
nx_SetGadgetState(#BottomSplitter,MiddleHorizontalPosition)
Case 2 ; Full
If nx_GetGadgetAttribute(#MiddleSplitter,#nxSplitter_FirstGadget)<>#TopSplitter
nxSplitter_Swap(#MiddleSplitter,#False)
EndIf
If nx_GetGadgetAttribute(#TopSplitter,#nxSplitter_FirstGadget)<>#StudentContainer
nxSplitter_Swap(#TopSplitter,#False)
nxSplitter_Exchange(#TopSplitter,#BottomSplitter,#False)
EndIf
nxSplitter_SetPos(#MiddleSplitter,MiddleBorderPosition,#False)
nx_SetGadgetState(#MiddleSplitter,#nxSplitter_AnchorSecondGadget)
nxSplitter_SetPos(#TopSplitter,StudentListWidth,#False)
nx_SetGadgetState(#TopSplitter,#nxSplitter_AnchorFirstGadget)
nx_SetGadgetState(#BottomSplitter,MiddleHorizontalPosition)
Case 3 ; Elementary
If nx_GetGadgetAttribute(#MiddleSplitter,#nxSplitter_FirstGadget)<>#TopSplitter
nxSplitter_Swap(#MiddleSplitter,#False)
EndIf
If nx_GetGadgetAttribute(#TopSplitter,#nxSplitter_FirstGadget)<>#StudentContainer
nxSplitter_Swap(#TopSplitter,#False)
nxSplitter_Exchange(#TopSplitter,#BottomSplitter,#False)
EndIf
nx_SetGadgetState(#MiddleSplitter,MiddleBorderPosition)
nx_SetGadgetState(#TopSplitter,StudentListWidth)
nx_SetGadgetState(#BottomSplitter,FavouritesTreeWidth)
EndSelect
EndProcedure

https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
- Arctic Fox
- Enthusiast
- Posts: 609
- Joined: Sun Dec 21, 2008 5:02 pm
- Location: Aarhus, Denmark
Re: Nexus -library of custom gadgets (updated : 28/7/09)
Regarding the nxExplorerBar:
Am I breaking something if I turn off the timer (MouseTimer) and instead call that procedure in nxExplorerBar_panelCallback() at a #WM_MOUSEMOVE event (to get rid of the #WM_TIMER event)?
Am I breaking something if I turn off the timer (MouseTimer) and instead call that procedure in nxExplorerBar_panelCallback() at a #WM_MOUSEMOVE event (to get rid of the #WM_TIMER event)?
Re: Nexus -library of custom gadgets (updated : 28/7/09)
Conceivably you will indeed be breaking something yes. #WM_MOUSEMOVE events will only be received when the mouse moves across whatever window you have subclassed to receive this message. This is fine except that nxExplorerBar sometimes needs to receive notifications beyond this - e.g. it needs to know when the mouse is not over the control etc. Relying upon #WM_MOUSEMOVE is not reliable in such situations. You would need to use something like the TrackMouseEvent() api instead.
Can I ask why you wish to remove the timer? It shouldn't clash with PB's new timer commands and events except that it has an eventID of 0. You might change this to something like 1000 to avoid clashes etc.
Can I ask why you wish to remove the timer? It shouldn't clash with PB's new timer commands and events except that it has an eventID of 0. You might change this to something like 1000 to avoid clashes etc.
I may look like a mule, but I'm not a complete ass.
- Arctic Fox
- Enthusiast
- Posts: 609
- Joined: Sun Dec 21, 2008 5:02 pm
- Location: Aarhus, Denmark
Re: Nexus -library of custom gadgets (updated : 28/7/09)
Oh, I see 
The #WM_TIMER event just seems to 'spoil' the meaning of WaitWindowEvent() as there is always an event occuring.
Is it then possible to call the procedure manually in the event loop as a response to #WM_MOUSEMOVE and #WM_MOUSELEAVE using TrackMouseEvent() as you suggest?

The #WM_TIMER event just seems to 'spoil' the meaning of WaitWindowEvent() as there is always an event occuring.
Is it then possible to call the procedure manually in the event loop as a response to #WM_MOUSEMOVE and #WM_MOUSELEAVE using TrackMouseEvent() as you suggest?
Re: Nexus -library of custom gadgets (updated : 28/7/09)
You will find (under Vista at least) that certain common controls use their own timers as well and so, well, is there any point trying to remove the nxExplorer timer just to satisfy WaitWindowEvent() as you'll only get caught by the other timers anyhow?
If you wish to use TrackMouseEvent() instead then, well, you'll need to be careful.
If you wish to use TrackMouseEvent() instead then, well, you'll need to be careful.
Last edited by srod on Sun Oct 04, 2009 2:26 pm, edited 1 time in total.
I may look like a mule, but I'm not a complete ass.
Re: Nexus -library of custom gadgets (updated : 28/7/09)
Okay Arctic, here is a test version of the nxExplorer which does not use a timer and instead uses the TrackMouseEvent() api.
http://www.purecoder.net/nxExplorerBar.pbi
Please let me know if it works okay because I haven't done much testing. If it passes the Artic test then I shall consider making this the official version.
http://www.purecoder.net/nxExplorerBar.pbi
Please let me know if it works okay because I haven't done much testing. If it passes the Artic test then I shall consider making this the official version.

I may look like a mule, but I'm not a complete ass.
- Arctic Fox
- Enthusiast
- Posts: 609
- Joined: Sun Dec 21, 2008 5:02 pm
- Location: Aarhus, Denmark
Re: Nexus -library of custom gadgets (updated : 28/7/09)
I have not run into these controls... yet
(except the highlight animation for ButtonGadgets and StringGadgets)
Your new test version of the nxExplorerBar works perfectly here - it even works with the Windows Vista Flip 3D (updates the window)
Tried with window sizing, minimizing, maximizing and 'cursor-out-of-window' - no problems
Thanks a bunch, srod, your help is very appreciated

Your new test version of the nxExplorerBar works perfectly here - it even works with the Windows Vista Flip 3D (updates the window)

Tried with window sizing, minimizing, maximizing and 'cursor-out-of-window' - no problems

Thanks a bunch, srod, your help is very appreciated
