It is currently Mon Dec 09, 2019 1:24 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [Done] Dialog problem with id='' entries.
PostPosted: Sat Mar 30, 2019 8:26 pm 
Offline
Addict
Addict

Joined: Fri Nov 09, 2012 11:04 pm
Posts: 1710
Location: Uttoxeter, UK
if I change line: 50 in the code below to:

Code:
         "            <checkbox id='' text='Set read only mode'/>" +


No error is flagged but sections of the Dialog are no longer displayed.
Surely id='' should be ignored or flagged as an error.


Code:
    #Dialog = 0
  #Xml = 0
 
  Runtime Enumeration Gadget
    #ListView
    #GeneralContainer
    #EditorContainer
    #BackupContainer
  EndEnumeration
 
  Procedure ShowPanels()
   
    HideGadget(#GeneralContainer, #True)
    HideGadget(#EditorContainer, #True)
    HideGadget(#BackupContainer, #True)
   
    Select GetGadgetState(#ListView)
      Case 0
        HideGadget(#GeneralContainer, #False)
       
      Case 1
        HideGadget(#EditorContainer, #False)
       
      Case 2
        HideGadget(#BackupContainer, #False)
    EndSelect
  EndProcedure
 
  Runtime Procedure OnListViewEvent()
    ShowPanels()
  EndProcedure
 
  XML$ = "<window id='#PB_Any' name='test' text='Preferences' minwidth='auto' minheight='auto' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
         "  <hbox expand='item:2'>" +
         "    <listview id='#ListView' width='100' onEvent='OnListViewEvent()'/>" +
         "    <multibox>" +
         "" +
         "      <container id='#GeneralContainer' invisible='yes'>" +
         "        <frame text='General'>" +
         "          <vbox expand='no'>" +
         "            <checkbox text='Enable red light'/>" +
         "            <checkbox text='Enable green light'/>" +
         "          </vbox>" +
         "        </frame>" +
         "      </container>" +
         "" +
         "      <container id='#EditorContainer' invisible='yes'>" +
         "        <frame text='Editor'>" +
         "          <vbox expand='no'>" +
         "            <checkbox text='Set read only mode'/>" +
         "            <checkbox text='Duplicate line automatically'/>" +
         "            <checkbox text='Enable monospace font'/>" +
         "          </vbox>" +
         "        </frame>" +
         "      </container>" +
         "" +
         "      <container  id='#BackupContainer' invisible='yes'>" +
         "      <frame text='Backup'>" +
         "        <vbox expand='no'>" +
         "          <checkbox text='Activate backup'/>" +
         "        </vbox>" +
         "      </frame>" +
         "      </container>" +
         "" +
         "    </multibox>" +
         "  </hbox>" +
         "</window>"
 
  If ParseXML(#Xml, XML$) And XMLStatus(#Xml) = #PB_XML_Success
   
    If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "test")
     
      AddGadgetItem(#ListView, -1, "General")
      AddGadgetItem(#ListView, -1, "Editor")
      AddGadgetItem(#ListView, -1, "Backup")
     
      SetGadgetState(#ListView, 0)
     
      ShowPanels()
     
      Repeat
        Event = WaitWindowEvent()
      Until Event = #PB_Event_CloseWindow
     
    Else 
      Debug "Dialog error: " + DialogError(#Dialog)
    EndIf
  Else
    Debug "XML error: " + XMLError(#Xml) + " (Line: " + XMLErrorLine(#Xml) + ")"
  EndIf   

_________________
DE AA EB


Top
 Profile  
Reply with quote  
 Post subject: Re: Dialog problem with id='' entries.
PostPosted: Fri Apr 12, 2019 1:35 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13646
Location: France
Fixed.


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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