Seite 1 von 1
PB 5.2 Beta 5 Dialog
Verfasst: 05.07.2013 01:57
von Andreas21
Dialog Bug beim verwenden von PB_Any
- "id" is the purebasic #Window id of the created dialog (if missing, it will be #PB_Any). "name" is the name you need to put in OpenXMLDialog().
http://forums.purebasic.com/german/view ... 7c#p314002
Wenn man id weg lest kommt es zum Fehler.
"Ungültiger Speicherzugriff. (Lesefehler an Adresse 4294967295)"
Auch id leer zu lassen bringt nichts.
OpenXMLDialog gibt dann immer 1 zurück genauso wie wenn man z.b. id="0" benutzen würde.
Re: PB 5.2 Beta 5 Dialog
Verfasst: 09.07.2013 13:46
von Andreas21
Kann keiner den bug bestätigen?
Re: PB 5.2 Beta 5 Dialog
Verfasst: 10.07.2013 10:42
von Chimorin
Gib uns einen Code und er wird ausgeführt

Von mir nicht, hab grade kein PB aufm PC.
Re: PB 5.2 Beta 5 Dialog
Verfasst: 10.07.2013 11:04
von Andreas21
Einfach den link im ersten Post benutzen und hoch scrollen^^
In der XML einfach mal id weg lassen.
ui.xml
Code: Alles auswählen
<?xml version="1.0"?>
<!-- Window -->
<window name="hello" text="Window" label="TestDialog" width="320" height="10" flags="#PB_Window_SizeGadget|#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget">
<splitter width="300" height="500">
<hbox>
<checkbox name="checkbox1" text="Run only one Instance" disabled="yes" Flags=""/>
<progressbar text="Vrey vreyv rye"/>
<trackbar text="Ole" invisible="no" Flags="#PB_TrackBar_Ticks" width="150"/>
<option text="option 1" name="option1" onevent="CheckBoxEvent()"/>
<option text="option 2"/>
</hbox>
<vbox>
<listview text="option 3" height="50"/>
<button text="Ole 2" name="button"/>
<listicon text="option 4" height="50"/>
<string text="string content"/>
<editor text="editorgadget" height="50"/>
<text text="Text gadget"/>
</vbox>
</splitter>
</window>
Code: Alles auswählen
Define Dialog, Xml, Button, Window
;<option text="option 1" .... onevent="CheckBoxEvent()"/>
Runtime Procedure CheckBoxEvent()
Debug "Option 1 clicked!"
EndProcedure
Xml = LoadXML(#PB_Any, "ui.xml")
If IsXML(Xml)
If XMLStatus(Xml) = #PB_XML_Success
Dialog = CreateDialog(#PB_Any)
;<window .... name="hello"
Window = OpenXMLDialog(Dialog, Xml, "hello")
If IsWindow(Window)
;<window id="0"
HideWindow(Window, #False)
;<button text="Ole 2" name="button"/>
Button = DialogGadget(Dialog,"button")
If IsGadget(Button)
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case Button
Debug "Button Ole 2 clicked!"
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf
Else
Debug "Dialog creation error: " + DialogError(Dialog)
EndIf
Else
Debug "XML error on line " + XMLErrorLine(Xml) + ": " + XMLError(Xml)
EndIf
EndIf