Hi!
I got some trouble starting your StringEx-Modul example.
In debug mode there is only an empty window showing up.
Without debug all seems to be allright, all gadgets are there.
I inserted then some debug lines to find out, that the modul
hangs in this line:
Code: Select all
String::Gadget(#StringPW, 225, 19, 100, 20, "Password", String::#Password|String::#ShowButton)
Here the modul example with debug:
Code: Select all
CompilerIf #PB_Compiler_IsMainFile
UsePNGImageDecoder()
#Window = 0
Enumeration 1
#String
#StringEx
#StringPW
#StringDel
#Font
#Popup
#Image
#Menu_Item1
#Menu_Item2
#Menu_Item3
#Menu_Item4
#Menu_Item5
EndEnumeration
LoadImage(#Image, "Delete.png")
If OpenWindow(#Window, 0, 0, 460, 60, "Window", #PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_SizeGadget)
If CreatePopupMenu(#Popup)
MenuItem(#Menu_Item1, "Undo")
MenuBar()
MenuItem(#Menu_Item2, "Copy")
MenuItem(#Menu_Item3, "Cut")
MenuItem(#Menu_Item4, "Paste")
MenuBar()
MenuItem(#Menu_Item5, "Delete")
EndIf
StringGadget(#String, 15, 19, 90, 20, "")
;SetGadgetAttribute(#String, #PB_String_MaximumLength, 5)
Debug "StringGadget"
String::Gadget(#StringEx, 120, 19, 90, 20, "AutoComplete", String::#AutoComplete) ; String::#ShowButton / String::#Numeric / String::#LowerCase / String::#UpperCase / String::#NotEditable / String::#BorderLess
Debug "String::Gadget(#StringEx)"
String::AttachPopupMenu(#StringEx, #Popup)
Debug "PopUp attached"
;String::SetAttribute(#StringEx, String::#MaximumLength, 5)
String::AddWords(#StringEx, "Default Define Declare Degree Debug AutoComplete")
Debug "AddWords"
String::Gadget(#StringPW, 225, 19, 100, 20, "Password", String::#Password|String::#ShowButton)
Debug "String::Gadget(#StringPW)"
String::Gadget(#StringDel, 340, 19, 100, 20, "Delete this")
Debug "String::Gadget(#StringDel)"
String::AddButton(#StringDel, #Image)
Debug "AddButton(#StringDel)"
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case #StringDel
If EventType() = String::#EventType_Button
String::Clear(#StringDel)
EndIf
EndSelect
Case #PB_Event_Menu
Select EventMenu()
Case #Menu_Item1
String::Undo(#StringEx)
Case #Menu_Item2
String::Copy(#StringEx)
Case #Menu_Item3
String::Cut(#StringEx)
Case #Menu_Item4
String::Paste(#StringEx)
Case #Menu_Item5
String::Delete(#StringEx)
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
String::Free(#StringEx)
CloseWindow(#Window)
EndIf
CompilerEndIf
After adding some debug statements in your modul, the last
successful line was:
Code: Select all
Procedure Gadget(GNum.i, X.i, Y.i, Width.i, Height.i, Content.s="", Flags.i=#False, WindowNum.i=#PB_Default)
Define Result.i, txtNum
Result = CanvasGadget(GNum, X, Y, Width, Height, #PB_Canvas_Keyboard)
If Result:Debug "Result= "+result
If GNum = #PB_Any : GNum = Result : EndIf: Debug "GNum="+gnum; <------------here--------------
If AddMapElement(StrgEx(), Str(GNum)):Debug "AddMapElement"
...
...
EndIf
Debug "After AddElement()"
EndIf
EndProcedure
The debug output shows:
StringGadget
Result= 32573484
GNum=2
AddMapElement
ShowPWButton enabled
Windows: GetGadgetFont()
Windows: Color
Before BindGadgetEvent()
finished burron creation
After AddElement()
String::Gadget(#StringEx)
PopUp attached
AddWords
Result= 22744230
GNum=3
Then it hangs. Any ideas?
Tested on Win7x65UltimateSP1, PB5.70LTSx64