It is currently Sat Jan 23, 2021 1:48 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: runtime constants for dialog library flags
PostPosted: Wed Nov 04, 2020 10:23 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Aug 28, 2019 1:01 pm
Posts: 112
Hi,

I've been trying to use dialog library, because it really makes my life easier, but I have a problem.
I need to use OS-specific flags for certain gadgets, e.g., string gadget, which dialog library does not support, and it would be really really nice if it let me specify runtime constants for them and then use it with the dialog.
I've tried loading a dialog and then manually freeing/recreating gadgets that I need the extra flags for, but that changes the tab order (the newly recreated gadgets appear last in the tab order).

Example (uncomment CompilerIf to see difference between recreated gadgets and not):

Code:
EnableExplicit
Runtime Enumeration gadgets: #l1: #msg: #l2: #l: #l3: #d: #l4: #filt: EndEnumeration
#flags=#ES_MULTILINE|#ESB_DISABLE_LEFT|#ESB_DISABLE_RIGHT|#ES_AUTOVSCROLL|#ES_AUTOHSCROLL|#WS_VSCROLL
LoadXML(0, "z.xml")
Define err.s=XMLError(0)
If err>""
MessageRequester(err, ""+XMLErrorLine(0)+", "+XMLErrorPosition(0))
EndIf
CreateDialog(0)
OpenXMLDialog(0, 0, "test")
err=DialogError(0)
If err>""
MessageRequester("error", err)
EndIf
;CompilerIf 0
Define g=DialogGadget(0, "msg")
If g=-1: debug "Can't find gadget.": CallDebugger: EndIf
Define gx=GadgetX(g), gy=GadgetY(g), gw=GadgetWidth(g), gh=GadgetHeight(g)
FreeGadget(g)
StringGadget(g, gx, gy, gw, gh, "", #flags)
g=DialogGadget(0, "d")
If g=-1: debug "Can't find gadget.": CallDebugger: EndIf
Define gx=GadgetX(g), gy=GadgetY(g), gw=GadgetWidth(g), gh=GadgetHeight(g)
FreeGadget(g)
StringGadget(g, gx, gy, gw, gh, "", #flags)
;CompilerEndIf

Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow


Code:
<window id="0" name="test" text="test" flags="#pb_window_screenCentered|#PB_Window_SizeGadget|#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget" minwidth="auto" minheight="auto" maxwidth="auto" maxheight="auto">
<hBox>
<vBox>
<text id="#l1" name="l1" text="message"/>
<string id="#msg" name="msg"/>
</vBox>
<vBox>
<text id="#l2" name="l2" text="chats"/>
<listicon id="#l" name="l"/>
</vBox>
<vBox>
<text id="#l3" name="l3" text="viewer"/>
<string id="#d" name="d"/>
</vBox>
<vBox>
<text id="#l4" name="l4" text="filter"/>
<listview id="#filt" name="filt"/>
</vBox>
</hBox>
</window>


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 27 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye