
I'll include this version in the next update.
Code: Select all
#INCLUDE_NEXUS_SPLITTER = 1 ;Declare this before including the Nexus source.
IncludePath "..\..\SOURCE\"
XIncludeFile "nxGadgets.pbi"
IncludePath ""
;Gadget#.
Enumeration
#Container
#Button1
#ListIcon
#Button2
#Splitter
EndEnumeration
;///////////////////////////////////////////////////////////////////////////////////////////
Procedure.l SplitterCallback(id, uMsg, wParam, lParam)
Protected result = #True
Select uMsg
Case #nxSplitter_GadgetsResized
If id = #Splitter
;Resize listicon.
;Note how we resize the width to keep pace with the container. This is to account for the user resizing the main window
;which will in turn resize the splitter control because of the #WM_SIZE handler below.
ResizeGadget(#ListIcon, #PB_Ignore, #PB_Ignore, GadgetWidth(#Container), wParam - 42)
EndIf
EndSelect
ProcedureReturn result
EndProcedure
If OpenWindow(0, 100, 100, 600, 600, "©nxSoftware - nxSplitter example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget)
ContainerGadget(#Container, 0, 0, 0, 0)
ButtonGadget(#Button1, 10, 10, 80, 20, "HELLO!")
ListIconGadget(#ListIcon, 0, 40, 0, 0, "ListIcon!", 120)
CloseGadgetList()
ButtonGadget(#Button2, 0,0,0,0, "CLICK")
;Create the nxSplitter.
nxSplitter_Create(#Splitter, 10,10, WindowWidth(0)-20, WindowHeight(0)-20, #Container, #Button2, 3, #nxSplitter_GripperWithDrag, @SplitterCallback())
Repeat
Event = WaitWindowEvent()
Select Event
Case #WM_SIZE
ResizeGadget(#Splitter, #PB_Ignore, #PB_Ignore, WindowWidth(0)-20, WindowHeight(0)-20)
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf
Code: Select all
Procedure.l SplitterCallback(id, uMsg, wParam, lParam)
Protected result
Select uMsg
Case #nxSplitter_GadgetsResized
Select id
Case #Splitter_Separation_Icones, #Splitter_Horizontal
;Resize listicon.
;Note how we resize the width to keep pace with the container. This is to account for the user resizing the main window
;which will in turn resize the splitter control because of the #WM_SIZE handler below.
ResizeGadget(#ListIcon_Group_icons, #PB_Ignore, #PB_Ignore, GadgetWidth(#Container_ListIcon_Group_icons), GadgetHeight(#Container_ListIcon_Group_icons) - #HauteurBarreSeparation)
result = #True
EndSelect
Case #nxSplitter_SliderAnchored
nx_SetGadgetAttribute(id, #nxSplitter_SliderType, #nxSplitter_GripperWithNoDrag)
result = #True
Case #nxSplitter_AnchorReleased
nx_SetGadgetAttribute(id, #nxSplitter_SliderType, #nxSplitter_GripperWithDrag)
result = #True
Case #nxSplitter_GripperClicked
result = #False
EndSelect
ProcedureReturn result
EndProcedure
Since I'm a plain idiot, I would ask something like "pleaaaase, help"...nx_SetGadgetItemText(#PropertyBox,5,"152")
nx_SetGadgetItemState(#PropertyBox,5,152)
nx_SetGadgetItemData(#PropertyBox,5,152)
Code: Select all
nx_SetGadgetItemText(1, 1, "New value text!", #nxPropertyBox_ValueText)
Code: Select all
Enumeration
#nxPropertyBox_LabelText = 1
#nxPropertyBox_ValueText
#nxPropertyBox_FontName
#nxPropertyBox_FilePathSelectorTitle
#nxPropertyBox_FileSelectorPattern
#nxPropertyBox_FileName
#nxPropertyBox_PathName
#nxPropertyBox_ComboOptionsText
#nxPropertyBox_LabelTextPriorToEdit ;Get only.
;Only valid before the newly added text is accepted by the #nxPropertyBox_ItemUpdated message.
#nxPropertyBox_ValueTextPriorToEdit ;Get only.
;Only valid before the newly added text is accepted by the #nxPropertyBox_ItemUpdated message.
EndEnumeration