Dialog library and vertical block expansion

Just starting out? Need help? Post your questions and find answers here.
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Dialog library and vertical block expansion

Post by boddhi »

Hello,

I'm having a little trouble with the Dialog library and vertical block expansion.

In an older version of one of my projects, I had the following code:

Code: Select all

EnableExplicit
;
Runtime Enumeration Fenetres  ;{
  #FEN_PRINCIPALE
EndEnumeration ;}
Runtime Enumeration Gadgets   ;{ Gadgets généraux
  #GAD_FP_LIB_RECHERCHE
  #GAD_FP_LS_PARAMRECHERCHE
  #GAD_FP_LS_HISTORECHERCHE
  #GAD_FP_BT_RECHERCHER
  #GAD_FP_BT_EPINGLER
  #GAD_FP_LS_CATEGORIES
  #GAD_FP_CT_LISTETOUT
  #GAD_FP_CT_LISTEBDD
  #GAD_FP_CT_LISTECOMPAT
  #GAD_FP_CT_LISTECUBE
  #GAD_FP_CT_LISTEDATE
  #GAD_FP_CT_LISTEFIN
  #GAD_FP_CT_LISTEINFO
  #GAD_FP_CT_LISTEINGE
  #GAD_FP_CT_LISTEINTERNET
  #GAD_FP_CT_LISTELOGIQUE
  #GAD_FP_CT_LISTEMATHS
  #GAD_FP_CT_LISTERECHREF
  #GAD_FP_CT_LISTESTATS
  #GAD_FP_CT_LISTETEXTE
  #GAD_FP_CT_LISTEUTIL
  #GAD_FP_CT_LISTERECHERCHE
  #GAD_FP_LS_LISTETOUT
  #GAD_FP_LS_LISTEBDD
  #GAD_FP_LS_LISTECOMPAT
  #GAD_FP_LS_LISTECUBE
  #GAD_FP_LS_LISTEDATE
  #GAD_FP_LS_LISTEFIN
  #GAD_FP_LS_LISTEINFO
  #GAD_FP_LS_LISTEINGE
  #GAD_FP_LS_LISTEINTERNET
  #GAD_FP_LS_LISTELOGIQUE
  #GAD_FP_LS_LISTEMATHS
  #GAD_FP_LS_LISTERECHREF
  #GAD_FP_LS_LISTESTATS
  #GAD_FP_LS_LISTETEXTE
  #GAD_FP_LS_LISTEUTIL
  #GAD_FP_LS_LISTERECHERCHE
  #GAD_FP_CP_FONCTION
  #GAD_FP_BT_COPIERFONCTION
  #GAD_FP_ED_DESCRIPTION
  #GAD_FP_LH_AIDE
EndEnumeration ;}
;
Define.i NoDialogue
Define.s ChaineXML
ChaineXML="<?xml version='1.0' encoding='UTF-16'?>"+Chr(10)+ ;{
          "<dialogs>"+Chr(10)+
          "  <window id='"+Str(#FEN_PRINCIPALE)+"' name='FEN_PRINCIPALE' text='Fonctions EXCEL' xpos='21' ypos='2' width='600' height='390' minwidth='380' minheight='198' flags='#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_SizeGadget|#PB_Window_Invisible|#PB_Window_ScreenCentered'>"+Chr(10)+
          "    <vbox expand='item:3' spacing='4'>"+Chr(10)+         ;{  Note : Here, expansion is only allowed to subitem 3
          "      <hbox expand='item:3' spacing='2'>"+Chr(10)+       ;{    Subitem 1
          "        <vbox expand='no' align='center' spacing='0'>"+Chr(10)+
          "          <text id='"+Str(#GAD_FP_LIB_RECHERCHE)+"' name='GAD_FP_LIB_RECHERCHE' text='Rechercher dans '/>"+Chr(10)+
          "        </vbox>"+Chr(10)+
          "        <combobox id='"+Str(#GAD_FP_LS_PARAMRECHERCHE)+"' name='GAD_FP_LS_PARAMRECHERCHE' width='88'/>"+Chr(10)+
          "        <combobox id='"+Str(#GAD_FP_LS_HISTORECHERCHE)+"' name='GAD_FP_LS_HISTORECHERCHE' flags='#PB_ComboBox_Editable'/>"+Chr(10)+
          "        <buttonimage id='"+Str(#GAD_FP_BT_RECHERCHER)+"' name='GAD_FP_BT_RECHERCHER'/>"+Chr(10)+
          "        <buttonimage id='"+Str(#GAD_FP_BT_EPINGLER)+"' name='GAD_FP_BT_EPINGLER'/>"+Chr(10)+
          "      </hbox>"+Chr(10)+ ;}
          "      <vbox expand='no' align=''>"+Chr(10)+              ;{    Subitem 2
          "        <combobox id='"+Str(#GAD_FP_LS_CATEGORIES)+"' name='GAD_FP_LS_CATEGORIES'/>"+Chr(10)+
          "      </vbox>"+Chr(10)+ ;}
          "      <multibox>"+Chr(10)+                               ;{    Subitem 3
          "        <container id='"+Str(#GAD_FP_CT_LISTETOUT)+"' name='GAD_FP_CT_LISTETOUT' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTETOUT)+"' name='GAD_FP_LS_LISTETOUT' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTEBDD)+"' name='GAD_FP_CT_LISTEBDD' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTEBDD)+"' name='GAD_FP_LS_LISTEBDD' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTECOMPAT)+"' name='GAD_FP_CT_LISTECOMPAT' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTECOMPAT)+"' name='GAD_FP_LS_LISTECOMPAT' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTECUBE)+"' name='GAD_FP_CT_LISTECUBE' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTECUBE)+"' name='GAD_FP_LS_LISTECUBE' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTEDATE)+"' name='GAD_FP_CT_LISTEDATE' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTEDATE)+"' name='GAD_FP_LS_LISTEDATE' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTEFIN)+"' name='GAD_FP_CT_LISTEFIN' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTEFIN)+"' name='GAD_FP_LS_LISTEFIN' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTEINFO)+"' name='GAD_FP_CT_LISTEINFO' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTEINFO)+"' name='GAD_FP_LS_LISTEINFO' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTEINGE)+"' name='GAD_FP_CT_LISTEINGE' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTEINGE)+"' name='GAD_FP_LS_LISTEINGE' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTEINTERNET)+"' name='GAD_FP_CT_LISTEINTERNET' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTEINTERNET)+"' name='GAD_FP_LS_LISTEINTERNET' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTELOGIQUE)+"' name='GAD_FP_CT_LISTELOGIQUE' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTELOGIQUE)+"' name='GAD_FP_LS_LISTELOGIQUE' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTEMATHS)+"' name='GAD_FP_CT_LISTEMATHS' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTEMATHS)+"' name='GAD_FP_LS_LISTEMATHS' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTERECHREF)+"' name='GAD_FP_CT_LISTERECHREF' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTERECHREF)+"' name='GAD_FP_LS_LISTERECHREF' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTESTATS)+"' name='GAD_FP_CT_LISTESTATS' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTESTATS)+"' name='GAD_FP_LS_LISTESTATS' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTETEXTE)+"' name='GAD_FP_CT_LISTETEXTE' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTETEXTE)+"' name='GAD_FP_LS_LISTETEXTE' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTEUTIL)+"' name='GAD_FP_CT_LISTEUTIL' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTEUTIL)+"' name='GAD_FP_LS_LISTEUTIL' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTERECHERCHE)+"' name='GAD_FP_CT_LISTERECHERCHE' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTERECHERCHE)+"' name='GAD_FP_LS_LISTERECHERCHE' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "      </multibox>"+Chr(10)+ ;}
          "      <vbox spacing='0'>"+Chr(10)+                       ;{    Subitem 4 (and followings subitems 5 & 6 : editor & hyperlink)
          "        <hbox expand='item:1' spacing='0'>"+Chr(10)+
          "          <vbox align='center' spacing='0'>"+Chr(10)+
          "            <string id='"+Str(#GAD_FP_CP_FONCTION)+"' name='GAD_FP_CP_FONCTION' flags='#PB_String_ReadOnly|#PB_String_BorderLess'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "          <buttonimage id='"+Str(#GAD_FP_BT_COPIERFONCTION)+"' name='GAD_FP_BT_COPIERFONCTION'/>"+Chr(10)+
          "        </hbox>"+Chr(10)+
          "      </vbox>"+Chr(10)+  ;}
          "      <editor id='"+Str(#GAD_FP_ED_DESCRIPTION)+"' name='GAD_FP_ED_DESCRIPTION' height='52' flags='#PB_Editor_ReadOnly|#PB_Editor_WordWrap'/>"+Chr(10)+
          "      <hyperlink id='"+Str(#GAD_FP_LH_AIDE)+"' name='GAD_FP_LH_AIDE' text='Hyperlink' flags='#PB_Hyperlink_Underline'/>"+Chr(10)+
          "    </vbox>"+Chr(10)+ ;}
          "  </window>"+Chr(10)+
          "</dialogs>" ;}
;
If ParseXML(0,ChaineXML)
  If XMLStatus(0)=#PB_XML_Success
    If CreateDialog(0)
      NoDialogue=OpenXMLDialog(0,0,"FEN_PRINCIPALE",0,0,0,0)
      If NoDialogue
        HideWindow(#FEN_PRINCIPALE,#False)
        Repeat
        Until WaitWindowEvent()=#PB_Event_CloseWindow
      EndIf
    EndIf
  EndIf
EndIf
If NoDialogue
  FreeXML(0)
  FreeDialog(0)
EndIf
For a better understanding of the dialog building, you can fold/unfold the string variable ChaineXML as follows:

Code: Select all

ChaineXML="<?xml version='1.0' encoding='UTF-16'?>"+Chr(10)+ ;{
          "<dialogs>"+Chr(10)+
          "  <window id='"+Str(#FEN_PRINCIPALE)+"' name='FEN_PRINCIPALE' text='Fonctions EXCEL' xpos='21' ypos='2' width='600' height='390' minwidth='380' minheight='198' flags='#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_SizeGadget|#PB_Window_Invisible|#PB_Window_ScreenCentered'>"+Chr(10)+
          "    <vbox expand='item:3' spacing='4'>"+Chr(10)+         ;{  Note : Here, expansion is only allowed to subitem 3
          "      <hbox expand='item:3' spacing='2'>"+Chr(10)+       ;{    Subitem 1
          "      <vbox expand='no' align=''>"+Chr(10)+              ;{    Subitem 2
          "      <multibox>"+Chr(10)+                               ;{    Subitem 3
          "      <vbox spacing='0'>"+Chr(10)+                       ;{    Subitem 4 (and followings subitems 5 & 6 : editor & hyperlink)
          "      <editor id='"+Str(#GAD_FP_ED_DESCRIPTION)+"' name='GAD_FP_ED_DESCRIPTION' height='52' flags='#PB_Editor_ReadOnly|#PB_Editor_WordWrap'/>"+Chr(10)+
          "      <hyperlink id='"+Str(#GAD_FP_LH_AIDE)+"' name='GAD_FP_LH_AIDE' text='Hyperlink' flags='#PB_Hyperlink_Underline'/>"+Chr(10)+
          "    </vbox>"+Chr(10)+ ;}
          "  </window>"+Chr(10)+
          "</dialogs>" ;}
 
And here, how the dialog behaves when the window is resized vertically:
Image
As you can see, only the multibox block (subitem 3) is reduced/expanded during resizing. It perfectly works!
 
 

Since then, I've decided to add a new feature that displays a new container while hiding some of the existing gadgets.
The new code:

Code: Select all

EnableExplicit
;
Runtime Enumeration Fenetres  ;{
  #FEN_PRINCIPALE
EndEnumeration ;}
Runtime Enumeration Gadgets   ;{ Gadgets généraux
  #GAD_FP_LIB_RECHERCHE
  #GAD_FP_LS_PARAMRECHERCHE
  #GAD_FP_LS_HISTORECHERCHE
  #GAD_FP_BT_RECHERCHER
  #GAD_FP_BT_EPINGLER
  #GAD_FP_LS_CATEGORIES
  #GAD_FP_CT_LISTETOUT
  #GAD_FP_CT_LISTEBDD
  #GAD_FP_CT_LISTECOMPAT
  #GAD_FP_CT_LISTECUBE
  #GAD_FP_CT_LISTEDATE
  #GAD_FP_CT_LISTEFIN
  #GAD_FP_CT_LISTEINFO
  #GAD_FP_CT_LISTEINGE
  #GAD_FP_CT_LISTEINTERNET
  #GAD_FP_CT_LISTELOGIQUE
  #GAD_FP_CT_LISTEMATHS
  #GAD_FP_CT_LISTERECHREF
  #GAD_FP_CT_LISTESTATS
  #GAD_FP_CT_LISTETEXTE
  #GAD_FP_CT_LISTEUTIL
  #GAD_FP_CT_LISTERECHERCHE
  #GAD_FP_LS_LISTETOUT
  #GAD_FP_LS_LISTEBDD
  #GAD_FP_LS_LISTECOMPAT
  #GAD_FP_LS_LISTECUBE
  #GAD_FP_LS_LISTEDATE
  #GAD_FP_LS_LISTEFIN
  #GAD_FP_LS_LISTEINFO
  #GAD_FP_LS_LISTEINGE
  #GAD_FP_LS_LISTEINTERNET
  #GAD_FP_LS_LISTELOGIQUE
  #GAD_FP_LS_LISTEMATHS
  #GAD_FP_LS_LISTERECHREF
  #GAD_FP_LS_LISTESTATS
  #GAD_FP_LS_LISTETEXTE
  #GAD_FP_LS_LISTEUTIL
  #GAD_FP_LS_LISTERECHERCHE
  #GAD_FP_CP_FONCTION
  #GAD_FP_BT_COPIERFONCTION
  #GAD_FP_ED_DESCRIPTION
  #GAD_FP_LH_AIDE
EndEnumeration ;}
;
Define.i NoDialogue
Define.s ChaineXML
ChaineXML="<?xml version='1.0' encoding='UTF-16'?>"+Chr(10)+ ;{
          "<dialogs>"+Chr(10)+
          "  <window id='"+Str(#FEN_PRINCIPALE)+"' name='FEN_PRINCIPALE' text='Fonctions EXCEL' xpos='21' ypos='2' width='600' height='390' minwidth='380' minheight='198' flags='#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_SizeGadget|#PB_Window_Invisible|#PB_Window_ScreenCentered'>"+Chr(10)+
          "    <vbox expand='item:3' spacing='4'>"+Chr(10)+         ;{  Note : Here, expansion is only allowed to subitem 3
          "      <hbox expand='item:3' spacing='2'>"+Chr(10)+       ;{    Subitem 1
          "        <vbox expand='no' align='center' spacing='0'>"+Chr(10)+
          "          <text id='"+Str(#GAD_FP_LIB_RECHERCHE)+"' name='GAD_FP_LIB_RECHERCHE' text='Rechercher dans '/>"+Chr(10)+
          "        </vbox>"+Chr(10)+
          "        <combobox id='"+Str(#GAD_FP_LS_PARAMRECHERCHE)+"' name='GAD_FP_LS_PARAMRECHERCHE' width='88'/>"+Chr(10)+
          "        <combobox id='"+Str(#GAD_FP_LS_HISTORECHERCHE)+"' name='GAD_FP_LS_HISTORECHERCHE' flags='#PB_ComboBox_Editable'/>"+Chr(10)+
          "        <buttonimage id='"+Str(#GAD_FP_BT_RECHERCHER)+"' name='GAD_FP_BT_RECHERCHER'/>"+Chr(10)+
          "        <buttonimage id='"+Str(#GAD_FP_BT_EPINGLER)+"' name='GAD_FP_BT_EPINGLER'/>"+Chr(10)+
          "      </hbox>"+Chr(10)+ ;}
          "      <vbox expand='no' align=''>"+Chr(10)+              ;{    Subitem 2
          "        <combobox id='"+Str(#GAD_FP_LS_CATEGORIES)+"' name='GAD_FP_LS_CATEGORIES'/>"+Chr(10)+
          "      </vbox>"+Chr(10)+ ;}
          "      <multibox>"+Chr(10)+                               ;{    Subitem 3
          "        <container id='"+Str(#GAD_FP_CT_LISTETOUT)+"' name='GAD_FP_CT_LISTETOUT' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTETOUT)+"' name='GAD_FP_LS_LISTETOUT' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTEBDD)+"' name='GAD_FP_CT_LISTEBDD' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTEBDD)+"' name='GAD_FP_LS_LISTEBDD' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTECOMPAT)+"' name='GAD_FP_CT_LISTECOMPAT' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTECOMPAT)+"' name='GAD_FP_LS_LISTECOMPAT' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTECUBE)+"' name='GAD_FP_CT_LISTECUBE' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTECUBE)+"' name='GAD_FP_LS_LISTECUBE' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTEDATE)+"' name='GAD_FP_CT_LISTEDATE' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTEDATE)+"' name='GAD_FP_LS_LISTEDATE' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTEFIN)+"' name='GAD_FP_CT_LISTEFIN' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTEFIN)+"' name='GAD_FP_LS_LISTEFIN' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTEINFO)+"' name='GAD_FP_CT_LISTEINFO' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTEINFO)+"' name='GAD_FP_LS_LISTEINFO' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTEINGE)+"' name='GAD_FP_CT_LISTEINGE' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTEINGE)+"' name='GAD_FP_LS_LISTEINGE' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTEINTERNET)+"' name='GAD_FP_CT_LISTEINTERNET' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTEINTERNET)+"' name='GAD_FP_LS_LISTEINTERNET' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTELOGIQUE)+"' name='GAD_FP_CT_LISTELOGIQUE' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTELOGIQUE)+"' name='GAD_FP_LS_LISTELOGIQUE' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTEMATHS)+"' name='GAD_FP_CT_LISTEMATHS' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTEMATHS)+"' name='GAD_FP_LS_LISTEMATHS' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTERECHREF)+"' name='GAD_FP_CT_LISTERECHREF' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTERECHREF)+"' name='GAD_FP_LS_LISTERECHREF' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTESTATS)+"' name='GAD_FP_CT_LISTESTATS' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTESTATS)+"' name='GAD_FP_LS_LISTESTATS' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTETEXTE)+"' name='GAD_FP_CT_LISTETEXTE' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTETEXTE)+"' name='GAD_FP_LS_LISTETEXTE' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTEUTIL)+"' name='GAD_FP_CT_LISTEUTIL' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTEUTIL)+"' name='GAD_FP_LS_LISTEUTIL' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "        <container id='"+Str(#GAD_FP_CT_LISTERECHERCHE)+"' name='GAD_FP_CT_LISTERECHERCHE' invisible='yes' margin='0'>"+Chr(10)+
          "          <vbox spacing='0'>"+Chr(10)+
          "            <listicon id='"+Str(#GAD_FP_LS_LISTERECHERCHE)+"' name='GAD_FP_LS_LISTERECHERCHE' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "        </container>"+Chr(10)+
          "      </multibox>"+Chr(10)+ ;}
          "      <vbox spacing='0'>"+Chr(10)+                       ;{    Subitem 4 (and followings subitems 5 & 6 : editor & hyperlink)
          "        <hbox expand='item:1' spacing='0'>"+Chr(10)+
          "          <vbox align='center' spacing='0'>"+Chr(10)+
          "            <string id='"+Str(#GAD_FP_CP_FONCTION)+"' name='GAD_FP_CP_FONCTION' flags='#PB_String_ReadOnly|#PB_String_BorderLess'/>"+Chr(10)+
          "          </vbox>"+Chr(10)+
          "          <buttonimage id='"+Str(#GAD_FP_BT_COPIERFONCTION)+"' name='GAD_FP_BT_COPIERFONCTION'/>"+Chr(10)+
          "        </hbox>"+Chr(10)+
          "      </vbox>"+Chr(10)+  ;}
          "      <editor id='"+Str(#GAD_FP_ED_DESCRIPTION)+"' name='GAD_FP_ED_DESCRIPTION' height='52' flags='#PB_Editor_ReadOnly|#PB_Editor_WordWrap'/>"+Chr(10)+
          "      <hyperlink id='"+Str(#GAD_FP_LH_AIDE)+"' name='GAD_FP_LH_AIDE' text='Hyperlink' flags='#PB_Hyperlink_Underline'/>"+Chr(10)+
          "    </vbox>"+Chr(10)+ ;}
          "  </window>"+Chr(10)+
          "</dialogs>" ;}
;
If ParseXML(0,ChaineXML)
  If XMLStatus(0)=#PB_XML_Success
    If CreateDialog(0)
      NoDialogue=OpenXMLDialog(0,0,"FEN_PRINCIPALE",0,0,0,0)
      If NoDialogue
        HideWindow(#FEN_PRINCIPALE,#False)
        Repeat
        Until WaitWindowEvent()=#PB_Event_CloseWindow
      EndIf
    EndIf
  EndIf
EndIf
If NoDialogue
  FreeXML(0)
  FreeDialog(0)
EndIf
As before, you can fold/unfold the ChaineXML variable as follows:

Code: Select all

ChaineXML="<?xml version='1.0' encoding='UTF-16'?>"+Chr(10)+ ;{
          "<dialogs>"+Chr(10)+
          "  <window id='"+Str(#FEN_PRINCIPALE)+"' name='FEN_PRINCIPALE' text='Fonctions EXCEL' xpos='21' ypos='2' width='600' height='390' minwidth='380' minheight='198' flags='#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_SizeGadget|#PB_Window_Invisible|#PB_Window_ScreenCentered'>"+Chr(10)+
          "    <vbox expand='item:3' spacing='4'>"+Chr(10)+         ;{  Note : Here, expansion is only allowed to subitem 3
          "      <hbox expand='item:3' spacing='2'>"+Chr(10)+       ;{    Subitem 1
          "      <vbox expand='no' align=''>"+Chr(10)+              ;{    Subitem 2
          "      <multibox>"+Chr(10)+                               ;{    Subitem 3
          "      <vbox spacing='0'>"+Chr(10)+                       ;{    Subitem 4 (and followings subitems 5 & 6 : editor & hyperlink)
          "      <editor id='"+Str(#GAD_FP_ED_DESCRIPTION)+"' name='GAD_FP_ED_DESCRIPTION' height='52' flags='#PB_Editor_ReadOnly|#PB_Editor_WordWrap'/>"+Chr(10)+
          "      <hyperlink id='"+Str(#GAD_FP_LH_AIDE)+"' name='GAD_FP_LH_AIDE' text='Hyperlink' flags='#PB_Hyperlink_Underline'/>"+Chr(10)+
          "    </vbox>"+Chr(10)+ ;}
          "  </window>"+Chr(10)+
          "</dialogs>" ;}
 
 
Here's how it behaves when I resize it:
Image
 
As you can see, although I've specified which items should be expanded (and by exclusion, which shouldn't), some blocks (subitems 1, 2 and 4) are still affected.
The only difference between the two codes is that I've included the first multibox in a new multibox which now contains two containers. The first with the old multibox and the second with the new feature (a list of hyperlinks).

In conclusion, I don't understand why all the blocks resize and not just the new multibox (new subitem 3).

If someone could enlighten me...
Thanks.
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
User avatar
jacdelad
Addict
Addict
Posts: 2032
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Dialog library and vertical block expansion

Post by jacdelad »

Hi boddhi,
I have Nightshift and just woken up, looking at my phone right now, so this is just a guess, not tested: Look at the combobox #GAD_FP_LS_CATEGORIES of your second example. It is the only member of a vbox. Remove the vbox and see what happens to the combobox.
If I guess, I think you put your gadgets into a few containers too much. Why use a vbox if it only has 1 member?
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: Dialog library and vertical block expansion

Post by boddhi »

Hi jacdelad
jacdelad wrote: I have Nightshift and just woken up, looking at my phone right now, [...]
There are some crazy people! Wake up, take his phone and go to PB forums! You really have to be an PBholic!!! :mrgreen: :P :lol: :wink:
Sincerly, I think I never consult PB forums from my smartphone :)
Look at the combobox #GAD_FP_LS_CATEGORIES of your second example. It is the only member of a vbox.
It's false, vbox contains a multibox subitem too and this vbox has a "expand='item:2" as flag.
jacdelad wrote: If I guess, I think you put your gadgets into a few containers too much. Why use a vbox if it only has 1 member?
I know it's possible to do things differently, but I chose this way for the sake of speed.
Each container contains a list of fixed data ( except one list) : a list for all data, a user search list and a list for each data category, i.e. 16 in all.
Selecting an item from the combo allows to quickly display the chosen list without having to repopulate a single list each time.

Voilà, voilà...
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
User avatar
jacdelad
Addict
Addict
Posts: 2032
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Dialog library and vertical block expansion

Post by jacdelad »

Sir, I have to tell you that I have doubts:
" <vbox expand='no' align=''>"+Chr(10)+ ;{ Subitem 2
" <combobox id='"+Str(#GAD_FP_LS_CATEGORIES)+"' name='GAD_FP_LS_CATEGORIES'/>"+Chr(10)+
" </vbox>"+Chr(10)+ ;}
...there's just the combobox inside.
BTW: Your second example does not cause problems here.

On the other topic: As I wrote in another post, I quit my job 3 months ago, but my employer does not let me go (I have 5 months of "Kündigungsfrist", which means if either the employer fires me or I quit, I am still employed for 5 months (if we don't find a different agreement)). Since this company is [censored], I can't go earlier. On top of that: We don't really have work, I'm just sitting, waiting, sleeping, reading, browsing, watching youtube videos...and get paid. So, much PureBasic for me. Don't ask...
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: Dialog library and vertical block expansion

Post by boddhi »

jacdelad wrote: Sir, I have to tell you that I have doubts:
All my apologies, you're right!!! I confused first and second post... :oops: :mrgreen:
However, this doesn't change anything... I've inserted this combo in a vbox (which I seem to have already tested before starting this thread) and the resizing effets are always the same.
jacdelad wrote: On the other topic: As I wrote in another post, I quit my job 3 months ago, [...]
Sorry, I don't see this. In France, we have also something similar but with more limited effects. It's called "clause de non-concurrence" (a “non-competition clause” in English ?).
But it's legally regulated. You can't work in the same job for a society in the same kind of business as your ex-company. However, it is limited in time (during which you receive compensation) and geographically. In any case, it must not prevent you from working if this is the only job you know to do, and is only valid if there is compensation.
Examples: If you're a vehicle salesman, you can be “forbidden” to work for another vehicle dealer, but not to be a salesman for other types of products.
On the contrary, if you're a pastry chef, it s not possible to impose a non-competition clause on you, as this would prevent you from quickly finding another job in your field of expertise.
Alas, that doesn't stop some dishonest companies from trying, and some people sometimes take their case to justice court (and win in the vast majority of cases).
Patience to you, even if I imagine it's not an easy situation.

In any case, to be clear and if any doubt, my remark on my previous post was a joke and in any way “malicious”. :wink:
That's what we call "The French humour" ! We have many compilations as this!!! :mrgreen: :lol:
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
User avatar
jacdelad
Addict
Addict
Posts: 2032
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Dialog library and vertical block expansion

Post by jacdelad »

To the dialog topic:
Which PB version, Windows version, x86/x64, etc.? Also, I don't know if maybe a vbox with one item autmatically resizes (not regarding the flags)?!

How about this (no unnecessary vboxes and containers):

Code: Select all

EnableExplicit
;
Runtime Enumeration Fenetres  ;{
  #FEN_PRINCIPALE
EndEnumeration ;}
Runtime Enumeration Gadgets   ;{ Gadgets généraux
  #GAD_FP_LIB_RECHERCHE
  #GAD_FP_LS_PARAMRECHERCHE
  #GAD_FP_LS_HISTORECHERCHE
  #GAD_FP_BT_RECHERCHER
  #GAD_FP_BT_EPINGLER
  #GAD_FP_LS_CATEGORIES
  #GAD_FP_CT_LISTETOUT
  #GAD_FP_CT_LISTEBDD
  #GAD_FP_CT_LISTECOMPAT
  #GAD_FP_CT_LISTECUBE
  #GAD_FP_CT_LISTEDATE
  #GAD_FP_CT_LISTEFIN
  #GAD_FP_CT_LISTEINFO
  #GAD_FP_CT_LISTEINGE
  #GAD_FP_CT_LISTEINTERNET
  #GAD_FP_CT_LISTELOGIQUE
  #GAD_FP_CT_LISTEMATHS
  #GAD_FP_CT_LISTERECHREF
  #GAD_FP_CT_LISTESTATS
  #GAD_FP_CT_LISTETEXTE
  #GAD_FP_CT_LISTEUTIL
  #GAD_FP_CT_LISTERECHERCHE
  #GAD_FP_LS_LISTETOUT
  #GAD_FP_LS_LISTEBDD
  #GAD_FP_LS_LISTECOMPAT
  #GAD_FP_LS_LISTECUBE
  #GAD_FP_LS_LISTEDATE
  #GAD_FP_LS_LISTEFIN
  #GAD_FP_LS_LISTEINFO
  #GAD_FP_LS_LISTEINGE
  #GAD_FP_LS_LISTEINTERNET
  #GAD_FP_LS_LISTELOGIQUE
  #GAD_FP_LS_LISTEMATHS
  #GAD_FP_LS_LISTERECHREF
  #GAD_FP_LS_LISTESTATS
  #GAD_FP_LS_LISTETEXTE
  #GAD_FP_LS_LISTEUTIL
  #GAD_FP_LS_LISTERECHERCHE
  #GAD_FP_CP_FONCTION
  #GAD_FP_BT_COPIERFONCTION
  #GAD_FP_ED_DESCRIPTION
  #GAD_FP_LH_AIDE
EndEnumeration ;}
;
Define.i NoDialogue
Define.s ChaineXML
ChaineXML="<?xml version='1.0' encoding='UTF-16'?>"+Chr(10)+ ;{
          "<dialogs>"+Chr(10)+
          "  <window id='"+Str(#FEN_PRINCIPALE)+"' name='FEN_PRINCIPALE' text='Fonctions EXCEL' xpos='21' ypos='2' width='600' height='390' minwidth='380' minheight='198' flags='#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_SizeGadget|#PB_Window_Invisible|#PB_Window_ScreenCentered'>"+Chr(10)+
          "    <vbox expand='item:3' spacing='4'>"+Chr(10)+         ;{  Note : Here, expansion is only allowed to subitem 3
          "      <hbox expand='item:3' spacing='2'>"+Chr(10)+       ;{    Subitem 1
          "        <vbox expand='no' align='center' spacing='0'>"+Chr(10)+
          "          <text id='"+Str(#GAD_FP_LIB_RECHERCHE)+"' name='GAD_FP_LIB_RECHERCHE' text='Rechercher dans '/>"+Chr(10)+
          "        </vbox>"+Chr(10)+
          "        <combobox id='"+Str(#GAD_FP_LS_PARAMRECHERCHE)+"' name='GAD_FP_LS_PARAMRECHERCHE' width='88'/>"+Chr(10)+
          "        <combobox id='"+Str(#GAD_FP_LS_HISTORECHERCHE)+"' name='GAD_FP_LS_HISTORECHERCHE' flags='#PB_ComboBox_Editable'/>"+Chr(10)+
          "        <buttonimage id='"+Str(#GAD_FP_BT_RECHERCHER)+"' name='GAD_FP_BT_RECHERCHER'/>"+Chr(10)+
          "        <buttonimage id='"+Str(#GAD_FP_BT_EPINGLER)+"' name='GAD_FP_BT_EPINGLER'/>"+Chr(10)+
          "      </hbox>"+Chr(10)+ ;}
          "      <vbox expand='no' align=''>"+Chr(10)+              ;{    Subitem 2
          "        <combobox id='"+Str(#GAD_FP_LS_CATEGORIES)+"' name='GAD_FP_LS_CATEGORIES'/>"+Chr(10)+
          "      </vbox>"+Chr(10)+ ;}
          "      <multibox>"+Chr(10)+                               ;{    Subitem 3
          "        <listicon id='"+Str(#GAD_FP_LS_LISTETOUT)+"' name='GAD_FP_LS_LISTETOUT' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "        <listicon id='"+Str(#GAD_FP_LS_LISTEBDD)+"' name='GAD_FP_LS_LISTEBDD' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "        <listicon id='"+Str(#GAD_FP_LS_LISTECOMPAT)+"' name='GAD_FP_LS_LISTECOMPAT' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "        <listicon id='"+Str(#GAD_FP_LS_LISTECUBE)+"' name='GAD_FP_LS_LISTECUBE' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "        <listicon id='"+Str(#GAD_FP_LS_LISTEDATE)+"' name='GAD_FP_LS_LISTEDATE' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "        <listicon id='"+Str(#GAD_FP_LS_LISTEFIN)+"' name='GAD_FP_LS_LISTEFIN' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "        <listicon id='"+Str(#GAD_FP_LS_LISTEINFO)+"' name='GAD_FP_LS_LISTEINFO' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "        <listicon id='"+Str(#GAD_FP_LS_LISTEINGE)+"' name='GAD_FP_LS_LISTEINGE' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "        <listicon id='"+Str(#GAD_FP_LS_LISTEINTERNET)+"' name='GAD_FP_LS_LISTEINTERNET' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "        <listicon id='"+Str(#GAD_FP_LS_LISTELOGIQUE)+"' name='GAD_FP_LS_LISTELOGIQUE' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "        <listicon id='"+Str(#GAD_FP_LS_LISTEMATHS)+"' name='GAD_FP_LS_LISTEMATHS' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "        <listicon id='"+Str(#GAD_FP_LS_LISTERECHREF)+"' name='GAD_FP_LS_LISTERECHREF' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "        <listicon id='"+Str(#GAD_FP_LS_LISTESTATS)+"' name='GAD_FP_LS_LISTESTATS' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "        <listicon id='"+Str(#GAD_FP_LS_LISTETEXTE)+"' name='GAD_FP_LS_LISTETEXTE' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "        <listicon id='"+Str(#GAD_FP_LS_LISTEUTIL)+"' name='GAD_FP_LS_LISTEUTIL' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "        <listicon id='"+Str(#GAD_FP_LS_LISTERECHERCHE)+"' name='GAD_FP_LS_LISTERECHERCHE' flags='#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection'/>"+Chr(10)+
          "      </multibox>"+Chr(10)+ ;}
          "      <hbox expand='item:1' spacing='0'>"+Chr(10)+
          "        <string id='"+Str(#GAD_FP_CP_FONCTION)+"' name='GAD_FP_CP_FONCTION' flags='#PB_String_ReadOnly|#PB_String_BorderLess'/>"+Chr(10)+
          "        <buttonimage id='"+Str(#GAD_FP_BT_COPIERFONCTION)+"' name='GAD_FP_BT_COPIERFONCTION'/>"+Chr(10)+
          "      </hbox>"+Chr(10)+
          "      <editor id='"+Str(#GAD_FP_ED_DESCRIPTION)+"' name='GAD_FP_ED_DESCRIPTION' height='52' flags='#PB_Editor_ReadOnly|#PB_Editor_WordWrap'/>"+Chr(10)+
          "      <hyperlink id='"+Str(#GAD_FP_LH_AIDE)+"' name='GAD_FP_LH_AIDE' text='Hyperlink' flags='#PB_Hyperlink_Underline'/>"+Chr(10)+
          "    </vbox>"+Chr(10)+ ;}
          "  </window>"+Chr(10)+
          "</dialogs>" ;}
;
If ParseXML(0,ChaineXML)
  If XMLStatus(0)=#PB_XML_Success
    If CreateDialog(0)
      NoDialogue=OpenXMLDialog(0,0,"FEN_PRINCIPALE",0,0,0,0)
      If NoDialogue
        HideWindow(#FEN_PRINCIPALE,#False)
        Repeat
        Until WaitWindowEvent()=#PB_Event_CloseWindow
      EndIf
    EndIf
  EndIf
EndIf
If NoDialogue
  FreeXML(0)
  FreeDialog(0)
EndIf
Works fine for me.
Also (maybe you already know): By adding invisible='yes' you can create an invisible dialog element. The listboxes in your multibox are all displayed on top of each other, I recommend to have only one visible on startup.

The other topic:
In Germany this is regulated by law too. That way employees can't get unemployed immediately (yes, there are exceptions, I know, but generally speaking). On the other hand, the employee can't just vanish and take all the knowledge without passing it to a successor. I understand the system, but as I said: I'm sitting on my ass with a bare minimum of for three months now, getting paid to watch YouTube, code PureMondrian, reading comics and so on...
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: Dialog library and vertical block expansion

Post by boddhi »

jacdelad wrote: To the dialog topic:
Which PB version, Windows version, x86/x64, etc.?
Win10 PB 6.11 both x64
Also, I don't know if maybe a vbox with one item autmatically resizes (not regarding the flags)?!
It does only if it and its parents have'nt expland="no" flags
How about this (no unnecessary vboxes and containers):
It works perfectly!!! And sincerly, I'm so ashamed!!! I foolishly used this technique because I had taken over some code I had developed that also had containers (also intended to be layered by hiding/showing them) but they all had different gadgets. Wanting to preserve this technique, I stupidly kept the same dialog structure without thinking for two seconds and made the new code heavier as a result.

But, because there is always a "but", this doesn't explain why some blocks resize when their flags don't “allow” them to do so.
Also (maybe you already know): By adding invisible='yes' you can create an invisible dialog element. The listboxes in your multibox are all displayed on top of each other, I recommend to have only one visible on startup.
Of course, I know :wink: In my code, it is (was for the future improvment :mrgreen: :wink: ) the containers that had this flag and were shown/hidden. Still following the logic of my old code, which I've taken over, I used to show/hide all the gadgets in a container at once simply by intervening on the container directly, rather than doing it one by one for each gadget..
I'm sitting on my ass with a bare minimum of for three months now, getting paid to watch YouTube, code PureMondrian, reading comics and so on...
To tell truth, there are worse things in life, aren't there? :mrgreen: :lol: :wink:
And if needed, this can serve. :evil: :D :wink:

Thanks you for your ligths
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
User avatar
jacdelad
Addict
Addict
Posts: 2032
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Dialog library and vertical block expansion

Post by jacdelad »

No problem and I'm glad that it works now.

Containers are uses to group more than one gadget into a defined space like a tab in a panelgadget. I also use them for some special "hacks" like replacing a gadget with another (to use flags that the dialog library does not support) and such (this way the dialog library doesnt notice the change).

My nightshift will be over in 3.5 hours. Finally weekend, yeah, coding at home! And you should go to sleep to (or are you in a different time zone?).
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: Dialog library and vertical block expansion

Post by boddhi »

Containers are uses to group more than one gadget into a defined space like a tab in a panelgadget. I also use them for some special "hacks" like replacing a gadget with another (to use flags that the dialog library does not support) and such (this way the dialog library doesnt notice the change).
For sure, I know that but, as I said, I did this stupidly from another old source code.
And the worst thing about it is that at any moment I realized this aberration. At any moment, it jumped out at me. :oops:
My nightshift will be over in 3.5 hours. Finally weekend, yeah, coding at home! And you should go to sleep to (or are you in a different time zone?).
For historical reasons (since Mr. SmallWithStrangeMustache and its 2nd World war), France inconsistently has the same time zone than Germany (geographically, the most logical would be to have the same as the UK)
And since it's the weekend, I'm staying up later. As I'm a light sleeper (5-6 hours), it's not a problem. :wink:
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
User avatar
HeX0R
Addict
Addict
Posts: 1219
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: Dialog library and vertical block expansion

Post by HeX0R »

Your usage of the runtime constants is pretty odd, I must admit
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: Dialog library and vertical block expansion

Post by boddhi »

Hello HeX0R,
HeX0R wrote: Your usage of the runtime constants is pretty odd, I must admit
I know this isn't the academic way of doing things, but the reason I do it this way is to save myself time searching when I've forgotten to declare a constant or there's an error in its name used as ID.
At the very beginning, I used the names as is standard practice, but sometimes I made a mistake of this type and spent much time trying to find out why the dialog (with a lot of gadgets) failed to open. So since then, I've proceeded like this. As PB allows it...
It allows me to be sure that the mistake didn't come from this type of error which is reported while the code is compiled and not after. :wink:
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
User avatar
HeX0R
Addict
Addict
Posts: 1219
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: Dialog library and vertical block expansion

Post by HeX0R »

But there is no need to "spend a lot of time to find the error", when an OpenXMLDialog() returns 0, all you have to call is use DialogError().
It will tell you exactly which constant is not defined or whatever was the reason for the fail.

Anyway, you are right, it is allowed and possible to go your way, but from my point of view you are loosing most advantages the dialogs are offering.
e.g. how are you going to use "real" xml dialogs then? You seem to keep stuck in building dialogs as strings in your sources.
Or you use names instead of IDs.
User avatar
jacdelad
Addict
Addict
Posts: 2032
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Dialog library and vertical block expansion

Post by jacdelad »

In bigger projects I name my gadgets #Gadget_..., my windows #Window_..., images #Image_... and so on. Sometimes I use another part in the name, when it's for a sub window and such. So I don't see what's odd with boddhis system?!
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Dialog library and vertical block expansion

Post by Fred »

Because he's using additional Str() which is not needed when using runtime stuff
User avatar
jacdelad
Addict
Addict
Posts: 2032
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Dialog library and vertical block expansion

Post by jacdelad »

Oh, I see. Didn't realize that.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Post Reply