Posted: Tue Nov 25, 2008 12:44 pm
This seems ideal. You could have a TrialPay button for the 12 month system.One for full updates for life and another for 12 months access to updates
http://www.purebasic.com
https://www.purebasic.fr/english/
This seems ideal. You could have a TrialPay button for the 12 month system.One for full updates for life and another for 12 months access to updates
Code: Select all
#INCLUDE_NEXUS_SPLITTER = 1 ;Declare this before including the Nexus source.
XIncludeFile "nxGadgets.pbi"
;///////////////////////////////////////////////////////////////////////////////////////////
Procedure.l SplitterCallback(id, uMsg, wParam, lParam)
Protected result = #True
Select uMsg
Case #nxSplitter_SliderAnchored
nx_SetGadgetAttribute(id, #nxSplitter_SliderType, #nxSplitter_GripperWithNoDrag)
Case #nxSplitter_AnchorReleased
nx_SetGadgetAttribute(id, #nxSplitter_SliderType, #nxSplitter_GripperWithDrag)
;Uncomment the following to prevent the anchored gadget being alternated.
;Instead we ensure that only the first gadget is collapsed and anchored etc.
; Case #nxSplitter_GripperClicked
; result = #nxSplitter_AnchorFirstGadget
EndSelect
ProcedureReturn result
EndProcedure
If OpenWindow(0, 100, 100, 600, 600, "©nxSoftware - nxSplitter example 2", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget)
ComboBoxGadget(1, 0,0,0,0)
ButtonGadget(2, 0,0,0,0, "CLICK 2")
EditorGadget(3,0,0,0,0)
;Create the two nxSplitters.
nxSplitter_Create(4, 0,0, 0, 0, 1, 2, 3, #nxSplitter_Vertical|#nxSplitter_GripperWithDrag, @SplitterCallback())
nxSplitter_Create(5, 40,40, WindowWidth(0)-80, WindowHeight(0)-80, 3, 4, 3, #nxSplitter_GripperWithDrag, @SplitterCallback())
;Set the color of the 'anchored sliders'.
nx_SetGadgetColor(4, #nxSplitter_AnchoredSliderColor, #Black)
nx_SetGadgetColor(5, #nxSplitter_AnchoredSliderColor, #Black)
Repeat
Event = WaitWindowEvent()
Select Event
Case #WM_SIZE
ResizeGadget(5, #PB_Ignore, #PB_Ignore, WindowWidth(0)-120, WindowHeight(0)-80)
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf
End
;///////////////////////////////////////////////////////////////////////////////////////////
Code: Select all
MoveWindow_(GadgetID(*nx\gad...
Code: Select all
ResizeGadget(*nx\gad...
I actually like the combo the way it is with MoveWindow_(), so I won't be making use of ResizeGadget() in this case. Feel free to add that yourself though (but of course any such alterations will not be added to the official download etc.)DoubleDutch wrote:How about checking the gadget type - if combo use resize, else use move?
Will check the new code soon - just trying to fix the car!
Code: Select all
;The following procedure positions and resizes the child gadgets following a resize etc.
Procedure nxSplitter_PositionGadgets(*nx._nxsplitter)
Protected rc.rect, hWnd, width, height
; If nxSplitter_IsChildGadget(*nx, *nx\gad1) And nxSplitter_IsChildGadget(*nx, *nx\gad2) ;Just to be safe.
hWnd = GadgetID(*nx\ctrlID)
GetClientRect_(hWnd, rc)
If *nx\styles&#nxSplitter_Vertical
width = *nx\splitterPos-#_nxsplitter_margin
If width < 0 : width = 0 : EndIf
If nxSplitter_IsChildGadget(*nx, *nx\gad1)
If GadgetType(*nx\gad1)=#PB_GadgetType_ComboBox
ResizeGadget(*nx\gad1, 0, 0, width, rc\bottom)
Else
MoveWindow_(GadgetID(*nx\gad1), 0, 0, width, rc\bottom,0)
EndIf
EndIf
width = rc\right - *nx\splitterPos - #_nxsplitter_margin - *nx\sliderWidth
If width < 0 : width = 0 : EndIf
If nxSplitter_IsChildGadget(*nx, *nx\gad2)
If GadgetType(*nx\gad2)=#PB_GadgetType_ComboBox
ResizeGadget(*nx\gad2, *nx\splitterPos+#_nxsplitter_margin+*nx\sliderWidth, 0, width, rc\bottom)
Else
MoveWindow_(GadgetID(*nx\gad2), *nx\splitterPos+#_nxsplitter_margin+*nx\sliderWidth, 0, width, rc\bottom,0)
EndIf
EndIf
Else
height = *nx\splitterPos-#_nxsplitter_margin
If height < 0 : height = 0 : EndIf
If nxSplitter_IsChildGadget(*nx, *nx\gad1)
If GadgetType(*nx\gad1)=#PB_GadgetType_ComboBox
ResizeGadget(*nx\gad1, 0, 0, rc\right, height)
Else
MoveWindow_(GadgetID(*nx\gad1), 0, 0, rc\right, height, 0)
EndIf
EndIf
height = rc\bottom - *nx\splitterPos - #_nxsplitter_margin - *nx\sliderWidth
If height < 0 : height = 0 : EndIf
If nxSplitter_IsChildGadget(*nx, *nx\gad2)
If GadgetType(*nx\gad1)=#PB_GadgetType_ComboBox
ResizeGadget(*nx\gad2, 0, *nx\splitterPos+#_nxsplitter_margin+*nx\sliderWidth, rc\right, height)
Else
MoveWindow_(GadgetID(*nx\gad2), 0, *nx\splitterPos+#_nxsplitter_margin+*nx\sliderWidth, rc\right, height, 0)
EndIf
EndIf
EndIf
; EndIf
EndProcedure
Code: Select all
;//line 608 of nxEplorerBar.pbi (PB4.30)
If *nxItem\hIcon
rcTemp\left = #_nxexplorerbar_margin+45
rcTemp\right = rcTemp\left + width-35
...
Code: Select all
#MENU_LATERAL = 1
Global TextoEstado.L
nxExplorerBar_Create(#MENU_LATERAL, 0, TBheight(#TB_Principal),MenuLateralAncho, Galtura, @ExplorerBarCallback())
Global nxEBItem.nxExplorerBar_NewItem
nxEBItem\type = #nxExplorerBar_Description
nxEBItem\font = FontID(LoadFont(#PB_Any, "Arial",10,#PB_Font_Bold))
TextoEstado = nx_AddGadgetItem(1, -1, "DESACTIVADO!", 0, nxEBItem)
...
;MAIN
nxExplorerBar_SetGadgetItemAttribute(#MENU_LATERAL, TextoEstado, #nxExplorerBar_DescriptionForeColor, #Red)
Code: Select all
nxExplorerBar_SetGadgetItemAttribute(menuid, itemid, #nxExplorerBar_DescriptionForeColor, MyColor)
Code: Select all
nx_SetGadgetColor(1, #nxExplorerBar_DescriptionForeColor, #Red)