This wishlist is more for Linux than anything else, anyway ...
- 1. Upgrade from GTK 2 to GTK 3 for the Gadget library will be nice.
- 2. Add GtkSwitch Gadget
- 3. Add GtkSpinner Gadget
Best regards.
Guimauve
This will be impossible just because End-Users can change the system default font. So the GUI look will change from one platform to the other. For example on Windows, I can be wrong, the default Font is "Trebuchet MS", on Linux Mint 12, I use "Mint Spirit" as default font.Kukulkan wrote:But I like to see a cross-platform layouting engine, too. It is annoying to create linux programs that most times looking like crap on other systems because the size of the gadgets, fonts, frames etc. is not the same than on yours
He wants gadgets to scale automatically with the font size.Guimauve wrote:This will be impossible just because End-Users can change the system default font. So the GUI look will change from one platform to the other. For example on Windows, I can be wrong, the default Font is "Trebuchet MS", on Linux Mint 12, I use "Mint Spirit" as default font.Kukulkan wrote:But I like to see a cross-platform layouting engine, too. It is annoying to create linux programs that most times looking like crap on other systems because the size of the gadgets, fonts, frames etc. is not the same than on yours
Yes, this is what I talk about. There are some layout engines like the one delivered with wxwidgets (http://docs.wxwidgets.org/stable/wx_siz ... eroverview). It allows you to create dialogs that resize to the needed size and keep the layout usable even with scaled fonts and other layout styles. It is very handy for people with bad eyes, too...He wants gadgets to scale automatically with the font size.
Code: Select all
<Window Name = "Window1" Text = "Dynamic Test!">
<VBox SizingVertically = "1" SizingHorizontally = "1" Name = "Container_frmShowOff">
<GBox SizingVertically = "1" SizingHorizontally = "1" Name = "frmShowOff" Text = "Collection Address">
<VBox SizingVertically = "1" SizingHorizontally = "1" Name = "Items_vbox_frmShowOff">
<HBox SizingVertically = "0" SizingHorizontally = "1" Name = "Items_hbox1_frmShowOff">
<Text SizingVertically = "2" SizingHorizontally = "0" Text = "Name :"/>
<String SizingVertically = "2" SizingHorizontally = "1" Name = "Collection_strName"/>
</HBox>
<HBox SizingVertically = "0" SizingHorizontally = "1">
<Text SizingVertically = "2" SizingHorizontally = "0" Text = "Line 1 :"/>
<String SizingVertically = "2" SizingHorizontally = "1" Name = "Collection_strLine1"/>
</HBox>
</VBox>
<Spacer SizingVertically = "0" SizingHorizontally = "1" Name = "Spacer1"/>
<Button SizingVertically = "1" SizingHorizontally = "1" Name = "ButtonMax1" Text = "Click!"/>
</GBox>
</VBox>
</Window>
Code: Select all
XIncludeFile "purevd.pbi"
; Test template
;{-- purevd start
Declare btnOk_Click()
Declare btnCancel_Click()
Procedure InitialiseGadgets()
Protected rv.i, WinID.i, tmpID.i
NewList Contain.i()
; AddGadget(pName.s, pParentID.i, pGadgetType.i, pText.s, pDesiredWidth.i, pDesiredHeight.i, pFlexWidthType.b, pFlexHeightType.b, pFlags.i = 0, pPath.s = "")
; add the window
AddElement(Contain())
Contain() = AddGadget("winMain", -1, -1, #PB_GadgetType_Window, "Main Window", 600, 400, 0, 0, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered)
WinID = Contain()
; All controls to be added here is in a verticle arrangement (vbox)
tmpID = Contain()
AddElement(Contain())
Contain() = AddGadget("Container_frmShowOff", tmpID, WinID, #PB_GadgetType_VBox, "", #PB_Any, #PB_Any, #Sizing_Stretch, #Sizing_Stretch)
; add a frame
tmpID = Contain()
AddElement(Contain())
Contain() = AddGadget("frmShowOff", tmpID, WinID, #PB_GadgetType_Frame3D, "Showing Off", #PB_Any, #PB_Any, #Sizing_Stretch, #Sizing_Stretch)
; All controls to be added here is in a verticle arrangement (vbox)
tmpID = Contain()
AddElement(Contain())
Contain() = AddGadget("Items_vbox_frmShowOff", tmpID, WinID, #PB_GadgetType_VBox, "", #PB_Any, #PB_Any, #Sizing_Stretch, #Sizing_Stretch)
; All controls to be added here is in a horizontal arrangement (hbox)
tmpID = Contain()
AddElement(Contain())
Contain() = AddGadget("Items_hbox1_frmShowOff", tmpID, WinID, #PB_GadgetType_HBox, "", #PB_Any, #PB_Any, #Sizing_Stretch, #Sizing_Stretch)
; add a text gadget set to minimum size
AddGadget("txtShowOff1", Contain(), WinID, #PB_GadgetType_Text, "Name", #PB_Any, #PB_Any, #Sizing_MinimumSize, #Sizing_Centre)
; add a string gadget set to fill the rest of the frame
AddGadget("strShowOff1", Contain(), WinID, #PB_GadgetType_String, "<Name goes here>", #PB_Any, #PB_Any, #Sizing_Stretch, #Sizing_Centre)
DeleteElement(Contain()) ; back up to frame
; add another set of controls in a horizontal arrangement (hbox)
tmpID = Contain()
AddElement(Contain())
Contain() = AddGadget("Items_hbox2_frmShowOff", tmpID, WinID, #PB_GadgetType_HBox, "", #PB_Any, #PB_Any, #Sizing_Stretch, #Sizing_Stretch)
; add a text gadget set to minimum size
AddGadget("txtShowOff2", Contain(), WinID, #PB_GadgetType_Text, "E-mail", #PB_Any, #PB_Any, #Sizing_MinimumSize, #Sizing_Centre)
; add a string gadget set to fill the rest of the frame
AddGadget("strShowOff2", Contain(), WinID, #PB_GadgetType_String, "<Password goes here>", #PB_Any, #PB_Any, #Sizing_Stretch, #Sizing_Centre)
DeleteElement(Contain()) ; back up to frame vbox
DeleteElement(Contain()) ; back up to frame
DeleteElement(Contain()) ; back up to window vbox
AddGadget("spacer1", Contain(), WinID, #PB_GadgetType_Spacer, "", #PB_Any, #PB_Any, #Sizing_Stretch, #Sizing_Stretch)
AddGadget("btnOk", Contain(), WinID, #PB_GadgetType_Button, "OK", 100, 100, #Sizing_Fixed, #Sizing_Fixed)
AddGadget("btnCancel", Contain(), WinID, #PB_GadgetType_Button, "Cancel", #PB_Any, #PB_Any, #Sizing_Stretch, #Sizing_Stretch)
EndProcedure
Procedure GadgetEventSelection(pWindowEvent, pGadgetEvent, pTypeEvent)
ForEach gl()
If pWindowEvent = gl()\WindowID And gl()\ID = pGadgetEvent
Break
EndIf
Next
Select gl()\Name
Case "btnOk"
If pTypeEvent = #PB_EventType_LeftClick
btnOK_Click()
EndIf
Case "btnCancel"
If pTypeEvent = #PB_EventType_LeftClick
btnCancel_Click()
EndIf
EndSelect
EndProcedure
Procedure MenuEventSelection(pWindowEvent, pMenuEvent)
ForEach gl()
If pWindowEvent = gl()\WindowID And gl()\ID = pMenuEvent
Break
EndIf
Next
Select gl()\Name
EndSelect
EndProcedure
;}-- purevd end
Procedure btnOk_Click()
MessageRequester("Main", "Name:" + GetGadgetText(GetGadgetID("winMain", "strShowOff1")) + Chr(13)+Chr(10) + "Email:" + GetGadgetText(GetGadgetID("winMain", "strShowOff2")))
EndProcedure
Procedure btnCancel_Click()
MessageRequester("Main", "Cancel")
EndProcedure
InitialiseGadgets()
EventLoop()