Topic
7 replies Latest Post - ‏2013-12-03T15:39:41Z by Molgy
Molgy
Molgy
14 Posts
ACCEPTED ANSWER

Pinned topic DXL Dialog resizeable

‏2013-11-22T12:13:08Z |

Hello DXL Experts,

I just have a problem to create a dialog box, which will be expand after clicking a button like the filter dialog box is doing by clicking the Advanced button.

After clicking the dialog box will expand...

Do you know.. how I can realize that too? Example program?

Many thanks in advance.

STB

 

 

Updated on 2013-11-22T12:17:50Z at 2013-11-22T12:17:50Z by Molgy
  • pommCannelle
    pommCannelle
    31 Posts
    ACCEPTED ANSWER

    Re: DXL Dialog resizeable

    ‏2013-11-22T14:02:20Z  in response to Molgy

    You can try this code ... 

    bool maxSize = false

    void setMaxSize ( DB x ) { setSize ( x, 300, 400 ); maxSize = true }
    void setMinSize ( DB x ) { setSize ( x, 300, 200 ); maxSize = false }

    void doResize ( DB x ) {
        if ( maxSize ) setMinSize x
        else setMaxSize x  
    }

    DB test = topMost "Yes we can !"
    apply ( test, "resize", doResize )

    realize test { setMinSize test }
    show test

     

    Post your code if you are in trouble ;)

  • Molgy
    Molgy
    14 Posts
    ACCEPTED ANSWER

    Re: DXL Dialog resizeable

    ‏2013-11-25T14:23:02Z  in response to Molgy

    Thank you Steeve,

    that helps a lot. But, you know... the next problem is coming directly:


    DBE box1 = null
    DBE box2 = null
    DBE box3 = null
    DBE box4 = null

    DBE re1DB = null
    DBE re2DB = null

    bool z02 = false
    bool z03 = false
    bool z04 = false

    // =====================================================

    void setMinSize ( DB db, bool z2, bool z3, bool z4 )
    {
        int z = 200
        int dx = 98


        if ( z2 )
            {
            z += dx

            box2->"top"->"spaced"->box1

            show box2
            }
        else
            {
            hide box2
            }

        if ( z3 )
            {
            z += dx

            if ( z2 )
                box3->"top"->"spaced"->box2
            else box3->"top"->"spaced"->box1

            show box3
            }
        else
            {
            hide box3
            }

        if ( z4 )
            {
            z += dx

            if ( z3 )
                box4->"top"->"spaced"->box3
            else
                {
                if ( z2 )
                    box4->"top"->"spaced"->box2
                else box4->"top"->"spaced"->box1
                }

            show box4
            }
        else
            {
            hide box4
            }

        realize db

        setSize ( db, 410, z );

    }

    void doResize1 ( DB x )
    {
         z03 = true

        setMinSize( x, z02, z03, z04 )

         inactive re1DB
    }

    void doResize2 ( DB x )
    {
         z04 = true
     
        setMinSize( x, z02, z03, z04 )

         inactive re2DB
    }
    // =====================================================

        DB db = topMost "Yes we can !"

        box1 = text( db, " Test1", " Test.",    400, 100, false )
        box2 = text( db, " Test2", " Test..",   400,  80, false )
        box3 = text( db, " Test3", " Test...",  400,  80, false )
        box4 = text( db, " Test4", " Test....", 400,  80, false )

        box1->"top"->"form"
        box1->"right"->"unattached"
        box1->"bottom"->"unattached"

        box2->"right"->"unattached"
        box2->"bottom"->"unattached"
        box3->"right"->"unattached"
        box3->"bottom"->"unattached"
        box4->"right"->"unattached"
        box4->"bottom"->"unattached"

        re1DB = apply ( db, "add box3", doResize1 )
        re2DB = apply ( db, "add box4", doResize2 )

        z02 = false

        setMinSize( db, z02, z03, z04 )

        show db

     

    If you explain this tiny code, you will find out that the boxes are indicated not coherently. Do you have an idee again?

    STB

    • pommCannelle
      pommCannelle
      31 Posts
      ACCEPTED ANSWER

      Re: DXL Dialog resizeable

      ‏2013-11-27T10:58:09Z  in response to Molgy

      Hi again !

      I don't think you can modify the placement of your DBE... We have to considere the DBE as a container for data, and nothing more.
      If you have to display a DBE at more than one position, then you should have to declare more than one DBE (one per position ...) and hide/show them to give the impression of deplacement.

      Here after an example to display (or not ... ) some DBE text.

      // define the GUI
      DB test

      DBE label1; DBE txt1
      DBE label2; DBE txt2
      DBE label3; DBE txt3

      // globals
      const string LABEL1 = "text 1"; const string DATA1 = "Text."
      const string LABEL2 = "text 2"; const string DATA2 = "Text.."
      const string LABEL3 = "text 3"; const string DATA3 = "Text..."

      const int CONF_ELEM = 3  

      Skip dbeList = create

      Skip dbeCONFIG = createString
      put ( dbeCONFIG, LABEL1"", DATA1"" )
      put ( dbeCONFIG, LABEL2"", DATA2"" )
      put ( dbeCONFIG, LABEL3"", DATA3"" )

      bool isDisplayedDATA1 = true
      bool isDisplayedDATA2 = true
      bool isDisplayedDATA3 = true
       
      // sizes ...
      const int emptyDB = 110
      const int labelSize = 25
      const int textSize = 100

      // mecanics
      DBE ::. ( Skip skp, int i ){
          DBE tmp = null; find( skp, i, tmp )
          return tmp
      }

      void displayDB ( Skip skpDATA ) {
          int i = 0; string curDATA = ""; string curLABEL = ""
          DBE tmp = null  
          int testSize = emptyDB
          for curDATA in skpDATA do {
              curLABEL = ( string key skpDATA )
              tmp = dbeList.(2*i); set ( tmp, curLABEL )
              show tmp
              tmp = dbeList.(2*i+1); set ( tmp, curDATA )
              show tmp
              i++
              testSize += labelSize + textSize
          }
          setSize ( test, 400, testSize )
          if ( i == CONF_ELEM ) return
          int j
          for j in i:(CONF_ELEM-1) do {
              tmp = dbeList.(2*j); hide tmp
              tmp = dbeList.(2*j+1); hide tmp
          }
      }

      // GUI's actions
      void doClose ( DB x ) {
          delete dbeList; delete dbeCONFIG
          hide x; destroy x
      }

      void doSelect1 ( DB x ) {
          if ( isDisplayedDATA1 ) { delete (dbeCONFIG, LABEL1"" ); isDisplayedDATA1 = false
          } else { put ( dbeCONFIG, LABEL1"", DATA1"" ); isDisplayedDATA1 = true }
          displayDB dbeCONFIG
      }
      void doSelect2 ( DB x ) {
          if ( isDisplayedDATA2 ) { delete (dbeCONFIG, LABEL2"" ); isDisplayedDATA2 = false
          } else { put ( dbeCONFIG, LABEL2"", DATA2"" ); isDisplayedDATA2 = true }
          displayDB dbeCONFIG
      }
      void doSelect3 ( DB x ) {
          if ( isDisplayedDATA3 ) { delete (dbeCONFIG, LABEL3"" ); isDisplayedDATA3 = false
          } else { put ( dbeCONFIG, LABEL3"", DATA3"" ); isDisplayedDATA3 = true }
          displayDB dbeCONFIG
      }

      // implements the GUI
      test = topMost "Yes, we can!"

      label1 = label ( test, LABEL1 ); txt1 = text( test, "", DATA1, 100, false )
      label2 = label ( test, LABEL2 ); txt2 = text( test, "", DATA2, 100, false )
      label3 = label ( test, LABEL3 ); txt3 = text( test, "", DATA3, 100, false )

      put ( dbeList, 0, label1 ); put ( dbeList, 1, txt1 )
      put ( dbeList, 2, label2 ); put ( dbeList, 3, txt2 )
      put ( dbeList, 4, label3 ); put ( dbeList, 5, txt3 )

      close ( test, false, doClose )

      apply ( test, "Text 1", doSelect1 )
      apply ( test, "Text 2", doSelect2 )
      apply ( test, "Text 3", doSelect3 )

      realize (test) { displayDB dbeCONFIG }
      show test

      I hope this snipet can help you to start ;)

  • Molgy
    Molgy
    14 Posts
    ACCEPTED ANSWER

    Re: DXL Dialog resizeable

    ‏2013-11-27T13:16:31Z  in response to Molgy

    Thank you Steeve.

    That's perfect!!!

    • Molgy
      Molgy
      14 Posts
      ACCEPTED ANSWER

      Re: DXL Dialog resizeable

      ‏2013-11-29T13:27:31Z  in response to Molgy

      Hello Steeve,

      I have recreate the code as you have suggested it. But, it is not working as I have aspected. So, I would like to ask you again.. 

      You will find 4 container. The first will be placed every time. The second shall be placed, if the button "Add Com" will be pressed. The other two container shall be placed at once.. if the button "Add Res" will be pressed. But deleting DBEs and replacing is not working correctly. Where is my fault?


      // define the GUI
      DB db

      DBE cnv

      DBE lab0
      DBE lab1
      DBE lab2
      DBE lab3

      DBE txt0
      DBE txt1
      DBE txt2
      DBE txt3

      DBE fld0
      DBE fld1
      DBE fld2
      DBE fld3

      DBE res0
      DBE res1

      DBE but1
      DBE but2


      // globals
      const string LABEL0 = "text 0"
      const string LABEL1 = "text 1"
      const string LABEL2 = "text 2"
      const string LABEL3 = "text 3"

      const string DATA0 = "Text"
      const string DATA1 = "Text."
      const string DATA2 = "Text.."
      const string DATA3 = "Text..."

       

      // ========================================================================================

      Skip dbeView = create
      Skip dbeList = create
      Skip dbeCONFIG0 = create
      Skip dbeCONFIG1 = create
      Skip dbeCONFIG2 = create
      Skip dbeCONFIG3 = create

      bool isDisplayedDATA1 = true
      bool isDisplayedDATA2 = true
       
      // sizes ...
      const int emptyDB = 100
      const int labelSize = 25
      const int textSize = 100

      const int CONF_ELEM = 4

      // ========================================================================================

      // mecanics
      DBE ::. ( Skip skp, int i )
      {
       DBE tmp = null

       find( skp, i, tmp )

       return tmp
      }

      void displayDBE( Skip skpList )
      {
       DBE tmp = null

       for tmp in skpList do
        {
        show tmp
        }

      } // end of displayDBE

      void hideDBE( Skip skpList )
      {
       DBE tmp = null

       for tmp in skpList do
        {
        hide tmp
        }

      } // end of hideDBE

      void displayDB( )
      {
       Skip curList

       int testSize = emptyDB
       int i = 0


       for curList in dbeView do
        {
        hideDBE( curList )
        i++
        }

       // print "\nDel: " i ""
       // i=0

       for curList in dbeList do
        {
        string txt = (string key dbeList)
       // print "\nKey: " txt ""

        displayDBE( curList )

        i++
        testSize += labelSize + textSize
        }

       //
       setSize( db, 768, testSize )

       //
       dbeView = dbeList

      } // end of displayDB

      // ========================================================================================

      void doSave ( DB x )
      {
       // TBD..

       

       // ==================================

       delete dbeView
       delete dbeList
       delete dbeCONFIG0
       delete dbeCONFIG1
       delete dbeCONFIG2

       hide x
       destroy x
      }

      // GUI's actions
      void doClose ( DB x )
      {
       delete dbeView
       delete dbeList
       delete dbeCONFIG0
       delete dbeCONFIG1
       delete dbeCONFIG2
       
       hide x
       destroy x
      }

      // ========================================================================================

      void doSelect1 ( DB x )
      {
       if ( !isDisplayedDATA1 )
        {
        delete( dbeList, LABEL1"" )
        isDisplayedDATA1 = true
        }
       else
        {
        put( dbeList, LABEL1"", dbeCONFIG1 );
        isDisplayedDATA1 = false
        }

       // isDisplayedDATA1 = !isDisplayedDATA1
       // print "\nBut: " isDisplayedDATA1 "  " isDisplayedDATA2 ""

       displayDB
      }

      void doSelect2 ( DB x )
      {
       if ( !isDisplayedDATA2 )
        {
        delete( dbeList, LABEL2"" )
        delete( dbeList, LABEL3"" )
        isDisplayedDATA2 = true
        }
       else
        {
        put( dbeList, LABEL2"", dbeCONFIG2 );
        put( dbeList, LABEL3"", dbeCONFIG3 );
        isDisplayedDATA2 = false
        }

       // isDisplayedDATA2 = !isDisplayedDATA2
       // print "\nBut: " isDisplayedDATA1 "  " isDisplayedDATA2 ""

       displayDB
      }


      // ========================================================================================

       int wBox = 600
       int hBox = 100
       int xBox =  10

       // implements the GUI
       db = create( "Yes, we can!", styleStandard )

       lab0 = label( db, LABEL0 )
       txt0 = text ( db, "", DATA0, wBox, hBox, false )

       lab1 = label( db, LABEL1 )
       txt1 = text ( db, "", DATA1, wBox, hBox, false )

       lab2 = label( db, LABEL2 )
       txt2 = text ( db, "", DATA2, wBox, hBox, false )

       lab3 = label( db, LABEL3 )
       txt3 = text ( db, "", DATA3, wBox, hBox, false )

       fld0 = field( db, "  Object Id:", "Mogly", xBox, true )
       fld1 = field( db, "     Source:", "Balu", xBox, true )
       fld2 = field( db, "     Status:", "Khan", xBox, false )
       fld3 = field( db, "     RDS-PP:", "Shir", xBox, false )

       res0 = field( db, "Res.Emp.Sta:", "R2D2", xBox, false )
       res1 = field( db, "Res.Sie.Sta:", "C3PO", xBox, false )

       

       // set position
       lab0->"top"->"form"
       txt0->"top"->"spaced"->lab0
       txt0->"right"->"unattached"

       fld0->"left"->"flush"->txt0
       fld0->"top"->"aligned"->txt0
       fld1->"left"->"aligned"->fld0
       fld1->"top"->"spaced"->fld0
       fld2->"left"->"aligned"->fld1
       fld2->"top"->"spaced"->fld1
       fld3->"left"->"aligned"->fld2
       fld3->"top"->"spaced"->fld2
       fld3->"bottom"->"unattached"

       // =============================

       lab1->"top"->"spaced"->txt0
       lab1->"right"->"unattached"
       txt1->"top"->"spaced"->lab1
       txt1->"right"->"unattached"

       // =============================

       lab2->"top"->"spaced"->txt1
       lab2->"right"->"unattached"
       txt2->"top"->"spaced"->lab2
       txt2->"right"->"unattached"

       res0->"left"->"flush"->txt2
       res0->"top"->"aligned"->txt2
       res1->"left"->"aligned"->res0
       res1->"top"->"spaced"->res0

       // =============================

       lab3->"top"->"spaced"->txt2
       lab3->"right"->"unattached"
       txt3->"top"->"spaced"->lab3
       txt3->"right"->"unattached"

       // fill skiplist
       put( dbeCONFIG0, 1, lab0 )
       put( dbeCONFIG0, 2, txt0 )
       put( dbeCONFIG0, 3, fld0 )
       put( dbeCONFIG0, 4, fld1 )
        put( dbeCONFIG0, 5, fld2 )
       put( dbeCONFIG0, 6, fld3 )

       put( dbeCONFIG1, 1, lab1 )
       put( dbeCONFIG1, 2, txt1 )

       put( dbeCONFIG2, 1, lab2 )
       put( dbeCONFIG2, 2, txt2 )
       put( dbeCONFIG2, 3, res0 )
       put( dbeCONFIG2, 4, res1 )

       put( dbeCONFIG3, 1, lab3 )
       put( dbeCONFIG3, 2, txt3 )


       //
       put( dbeList, LABEL0"", dbeCONFIG0 )

       put( dbeView, LABEL0"", dbeCONFIG0 )
       put( dbeView, LABEL1"", dbeCONFIG1 )
       put( dbeView, LABEL2"", dbeCONFIG2 )
       put( dbeView, LABEL3"", dbeCONFIG3 )

       // create button
       but1 = apply( db, "Add Com", doSelect1 )
       but2 = apply( db, "Add Res", doSelect2 )
       apply( db, "Save", doSave )
       close( db, true, doClose )

       // draw GUI
       realize( db ) 

       displayDB()

       show( db )

       

      If you like, you can me directly by using scaramouch@gmx.de.

      Thanks in advance.

      STB

       

       

      • pommCannelle
        pommCannelle
        31 Posts
        ACCEPTED ANSWER

        Re: DXL Dialog resizeable

        ‏2013-12-02T15:44:06Z  in response to Molgy

        Hmmm ... I think you missed the fact that the skip list was a smart way to avoid to write a lot of code ;)
        But the fact is that you need as many DBE structures as differents placement to display your data.
        You can have severals display configurations ...
        CONF A   |CONF B     |CONF C     |CONF D     |CONF E ...
        bloc 0      |bloc 0        |bloc 0          |bloc 0          |bloc 0
        bloc 1      |bloc 1        |bloc 3          |bloc 2          |
        bloc 2      |bloc 3        |
        bloc 3      |
        As you can see here, the data displayed in bloc 2(CONF A) needs the same DBE structure twice ( in position 1 for CONFD, position 2 for CONF A ... ) in order to be abble to be displayed in 2 differents locations.
        And yes ... 3 times for bloc 3 o;)
        In my previous example, all DBE structures were the same ... little scam on my part, sorry about that ;)
        Here after a corrected version of your code ... I hope this one can help you.

        // define the GUI
        DB db

        // You need 4 blocs ...
        // Availables configurations are :
        // CONF A   |CONF B     |CONF C     |CONF D     |CONF E ...
        // bloc 0   |bloc 0     |bloc 0     |bloc 0     |bloc 0   | ...
        // bloc 1   |bloc 1     |bloc 3     |bloc 2     |
        // bloc 2   |bloc 3     |           |           |
        // bloc 3   |           |           |           
        // So you need to have
        // 1 container definition for the data0 of bloc 0
        // 1 container definition for the data1 of bloc 1
        // 2 container definition for the data2 of bloc 2
        // 3 container definition for the data3 of bloc 3
        // well ... in fact you can re-use the container
        // defined for bloc 1 in CONF A/B to display
        // data3 in CONF C ...
        // Let's do that !

        // BLOC 0 - ALWAYS IN POSITION 0
        DBE lab0; DBE txt0
        DBE fld0; DBE fld1; DBE fld2; DBE fld3

        // BLOC 1 - ALWAYS IN POSITION 1
        DBE lab1; DBE txt1

        // BLOC 2 - CAN BE IN POSITION 1 / 2
        // POSITION 1
        DBE lab2_pos1; DBE lab2_pos2
        DBE txt2_pos1; DBE txt2_pos2
        DBE res0_pos1; DBE res0_pos2
        DBE res1_pos1; DBE res1_pos2

        // BLOC 3 - CAN BE IN POSITION 1 / 2 / 3
        // POSITION 1
        // - container corresponding to position 1 is not needed ...
        DBE lab3_pos2; DBE lab3_pos3
        DBE txt3_pos2; DBE txt3_pos3

        // due to the differences in the containers,
        // the skip structure is not so smart to use here ;)
        // to use a state machine seem's the good way to
        // implement this GUI ...

        // globals
        const string LABEL0 = "text 0"; const string LABEL1 = "text 1"
        const string LABEL2 = "text 2"; const string LABEL3 = "text 3"

        const string DATA0 = "Text"; const string DATA1 = "Text."
        const string DATA2 = "Text.."; const string DATA3 = "Text..."

        const string BTN1 = "BLOC 1"; const string BTN2 = "BLOC 2"
        const string BTN3 = "BLOC 3"

        string STATE = ""
        // ========================================================================================
        // sizes ...
        const int emptyDB = 100
        const int labelSize = 25
        const int textSize = 100

        // ========================================================================================
        // mecanics

        // display state 0 -> B0
        // display state 1 -> B0 / B1
        // display state 2 -> B0 / B2
        // display state 3 -> B0 / B3
        // display state 4 -> B0 / B1 / B2
        // display state 5 -> B0 / B1 / B3
        // display state 6 -> B0 / B2 / B3
        // display state 7 -> B0 / B1 / B2 / B3

        const int sizeS0 = emptyDB + 5*labelSize // to be sure to see the 4 labels on the right ...
        const int sizeS1 = emptyDB + 5*labelSize + labelSize + textSize
        const int sizeS4 = emptyDB + 5*labelSize + 2*(labelSize + textSize)
        const int sizeS7 = emptyDB + 5*labelSize + 3*(labelSize + textSize)

        // define how th show/hide the states components
        void displayB0 ( ) {
            show lab0; show txt0; show fld0;
            show fld1; show fld2; show fld3
        }
        // NO NEED void hideB0 () { }

        void displayB1 ( string dataToDisplay ) { // a little difference to display data 3 ;)
            show lab1; show txt1
            if ( dataToDisplay"" == "data 1" ) { set ( lab1, LABEL1 "" ); set ( txt1, DATA1"" ) }
            else { set ( lab1, LABEL3 "" ); set ( txt1, DATA3"" ) }
        }
        void hideB1 ( ) { hide lab1; hide txt1 }

        void displayB2_pos1 () { show lab2_pos1; show txt2_pos1; show res0_pos1; show res1_pos1 }
        void hideB2_pos1 () { hide lab2_pos1;hide txt2_pos1; hide res0_pos1; hide res1_pos1 }

        void displayB2_pos2 () { show lab2_pos2; show txt2_pos2; show res0_pos2; show res1_pos2}
        void hideB2_pos2 () { hide lab2_pos2; hide txt2_pos2; hide res0_pos2; hide res1_pos2}

        void displayB3_pos1 () { displayB1 "data 3" }
        void hideB3_pos1 () { hideB1 }

        void displayB3_pos2 () { show lab3_pos2; show txt3_pos2 }
        void hideB3_pos2 () { hide lab3_pos2; hide txt3_pos2 }

        void displayB3_pos3 () { show lab3_pos3; show txt3_pos3 }
        void hideB3_pos3 () { hide lab3_pos3; hide txt3_pos3 }

        void displayS0() {
            displayB0; hideB1; hideB2_pos1; hideB2_pos2; /*hideB3_pos1*/; hideB3_pos2; hideB3_pos3
            setSize ( db, 800, sizeS0 )
        }
        void displayS1() {
            displayB0; displayB1 "data 1"; hideB2_pos1; hideB2_pos2;  /*hideB3_pos1*/; hideB3_pos2; hideB3_pos3
            setSize ( db, 800, sizeS1 )
        }
        void displayS2() {
            displayB0; hideB1; displayB2_pos1; hideB2_pos2;  /*hideB3_pos1*/; hideB3_pos2; hideB3_pos3
            setSize ( db, 800, sizeS1 )
        }
        void displayS3() {
            displayB0; hideB1; hideB2_pos1; hideB2_pos2; displayB3_pos1; hideB3_pos2; hideB3_pos3
            setSize ( db, 800, sizeS1 )
        }
        void displayS4() {
            displayB0; displayB1 "data 1"; hideB2_pos1; displayB2_pos2; /*hideB3_pos1*/; hideB3_pos2; hideB3_pos3
            setSize ( db, 800, sizeS4 )
        }
        void displayS5() {
            displayB0; displayB1 "data 1"; hideB2_pos1; hideB2_pos2; /*hideB3_pos1*/; displayB3_pos2; hideB3_pos3
            setSize ( db, 800, sizeS4 )
        }
        void displayS6() {
            displayB0; hideB1; hideB2_pos1; displayB2_pos1; hideB2_pos2; /*hideB3_pos1*/; displayB3_pos2; hideB3_pos3
            setSize ( db, 800, sizeS4 )
        }
        void displayS7() {
            displayB0; displayB1 "data 1"; hideB2_pos1; /*hideB3_pos1*/; displayB2_pos2; hideB3_pos2; displayB3_pos3
            setSize ( db, 800, sizeS7 )
        }

        void display( string config ){
            // print "*"config "*\n"
            if ( config"" == "S0" ) { displayS0; return }; if ( config"" == "S1" ) { displayS1; return }
            if ( config"" == "S2" ) { displayS2; return }; if ( config"" == "S3" ) { displayS3; return }
            if ( config"" == "S4" ) { displayS4; return }; if ( config"" == "S5" ) { displayS5; return }
            if ( config"" == "S6" ) { displayS6; return }; if ( config"" == "S7" ) { displayS7 }    
        }

        // TRANSITIONS
        // S0->S1 = BTN1; S0->S2 = BTN2; S0->S3 = BTN3
        // S1->S0 = BTN1; S1->S4 = BTN2; S1->S5 = BTN3
        // S2->S4 = BTN1; S2->S0 = BTN2; S2->S6 = BTN3
        // S3->S5 = BTN1; S3->S6 = BTN2; S3->S0 = BTN3
        // S4->S2 = BTN1; S4->S1 = BTN2; S4->S7 = BTN3
        // S5->S3 = BTN1; S5->S7 = BTN2; S5->S2 = BTN3
        // S6->S7 = BTN1; S6->S3 = BTN2; S6->S2 = BTN3
        // S7->S6 = BTN1; S7->S5 = BTN2; S7->S4 = BTN3
        Skip correspondanceBTN1 = createString
        put ( correspondanceBTN1, "S0", "S1" ); put ( correspondanceBTN1, "S1", "S0" )
        put ( correspondanceBTN1, "S2", "S4" ); put ( correspondanceBTN1, "S3", "S5" )
        put ( correspondanceBTN1, "S4", "S2" ); put ( correspondanceBTN1, "S5", "S3" )
        put ( correspondanceBTN1, "S6", "S7" ); put ( correspondanceBTN1, "S7", "S6" )
        Skip correspondanceBTN2 = createString
        put ( correspondanceBTN2, "S0", "S2" ); put ( correspondanceBTN2, "S1", "S4" )
        put ( correspondanceBTN2, "S2", "S0" ); put ( correspondanceBTN2, "S3", "S6" )
        put ( correspondanceBTN2, "S4", "S1" ); put ( correspondanceBTN2, "S5", "S7" )
        put ( correspondanceBTN2, "S6", "S3" ); put ( correspondanceBTN2, "S7", "S5" )
        Skip correspondanceBTN3 = createString
        put ( correspondanceBTN3, "S0", "S3" ); put ( correspondanceBTN3, "S1", "S5" )
        put ( correspondanceBTN3, "S2", "S6" ); put ( correspondanceBTN3, "S3", "S0" )
        put ( correspondanceBTN3, "S4", "S7" ); put ( correspondanceBTN3, "S5", "S2" )
        put ( correspondanceBTN3, "S6", "S2" ); put ( correspondanceBTN3, "S7", "S4" )
        // ========================================================================================
        // GUI's actions
        void doClose ( DB x ){
            delete correspondanceBTN1
            delete correspondanceBTN2
            delete correspondanceBTN3
            hide x; destroy x
        }

        void doSave ( DB x ){
            // TBD..
            // ==================================
            doClose x
        }

        void doSelectBTN1 ( DB x ) { find ( correspondanceBTN1, STATE"", STATE ); display( STATE"" ) }
        void doSelectBTN2 ( DB x ) { find ( correspondanceBTN2, STATE"", STATE ); display( STATE"" ) }
        void doSelectBTN3 ( DB x ) { find ( correspondanceBTN3, STATE"", STATE ); display( STATE"" ) }
        // ========================================================================================
        int wBox = 600
        int hBox = 100
        int xBox =  10

        // implements the GUI
        db = create( "Yes, we can!", styleStandard )

        // BLOC 0
        lab0 = label( db, LABEL0 ); txt0 = text ( db, "", DATA0, 100, false )

        fld0 = field( db, "  Object Id:", "Mogly", xBox, true )

        fld1 = field( db, "     Source:", "Balu", xBox, true )
        fld2 = field( db, "     Status:", "Khan", xBox, false )
        fld3 = field( db, "     RDS-PP:", "Shir", xBox, false )

        // BLOC 1
        lab1 = label( db, LABEL1 )
        txt1 = text ( db, "", DATA1, wBox, hBox, false )

        // BLOC 2
        lab2_pos1 = label( db, LABEL2 )
        txt2_pos1 = text ( db, "", DATA2, wBox, hBox, false )
        res0_pos1 = field( db, "Res.Emp.Sta:", "R2D2", xBox, false )
        res1_pos1 = field( db, "Res.Sie.Sta:", "C3PO", xBox, false )

        lab2_pos2 = label( db, LABEL2 )
        txt2_pos2 = text ( db, "", DATA2, wBox, hBox, false )
        res0_pos2 = field( db, "Res.Emp.Sta:", "R2D2", xBox, false )
        res1_pos2 = field( db, "Res.Sie.Sta:", "C3PO", xBox, false )

        // BLOC 3
        // for pos1, lab1/txt1 will be used ...
        lab3_pos2 = label( db, LABEL3 )
        txt3_pos2 = text ( db, "", DATA3, wBox, hBox, false )

        lab3_pos3 = label( db, LABEL3 )
        txt3_pos3 = text ( db, "", DATA3, wBox, hBox, false )

        // set positions

        // BLOC 0
        txt0->"right"->"unattached"; txt0->"bottom"->"unattached"
        fld0->"left"->"spaced"->txt0; fld0->"top"->"spaced"->lab0
        fld1->"left"->"aligned"->fld0; fld1->"top"->"spaced"->fld0
        fld2->"left"->"aligned"->fld1; fld2->"top"->"spaced"->fld1
        fld3->"left"->"aligned"->fld2; fld3->"top"->"spaced"->fld2
        fld3->"bottom"->"unattached"

        // BLOC 1
        lab1->"top"->"spaced"->txt0; lab1->"right"->"unattached"
        txt1->"top"->"spaced"->lab1; txt1->"right"->"unattached"

        // BLOC 2
        lab2_pos1->"top"->"spaced"->txt0; lab2_pos1->"right"->"unattached"
        txt2_pos1->"top"->"spaced"->lab2_pos1; txt2_pos1->"right"->"unattached"
        res0_pos1->"left"->"flush"->txt2_pos1; res0_pos1->"top"->"spaced"->lab2_pos1
        res1_pos1->"left"->"aligned"->res0_pos1; res1_pos1->"top"->"spaced"->res0_pos1

        lab2_pos2->"top"->"spaced"->txt1; lab2_pos2->"right"->"unattached"
        txt2_pos2->"top"->"spaced"->lab2_pos2; txt2_pos2->"right"->"unattached"
        res0_pos2->"left"->"flush"->txt2_pos2; res0_pos2->"top"->"spaced"->lab2_pos2
        res1_pos2->"left"->"aligned"->res0_pos2; res1_pos2->"top"->"spaced"->res0_pos2

        //BLOC 3
        lab3_pos2->"top"->"spaced"->txt2_pos1; lab3_pos2->"right"->"unattached"
        txt3_pos2->"top"->"spaced"->lab3_pos2; txt3_pos2->"right"->"unattached"

        lab3_pos3->"top"->"spaced"->txt2_pos2; lab3_pos3->"right"->"unattached"
        txt3_pos3->"top"->"spaced"->lab3_pos3; txt3_pos3->"right"->"unattached"

        // define buttons
        apply( db, BTN1"", doSelectBTN1 )
        apply( db, BTN2"", doSelectBTN2 )
        apply( db, BTN3"", doSelectBTN3 )
        apply( db, "Save", doSave ); close( db, true, doClose )

        // draw GUI
        realize( db )
        STATE = "S0"
        display STATE

        show( db )

         

        Updated on 2013-12-02T16:45:20Z at 2013-12-02T16:45:20Z by pommCannelle
        • Molgy
          Molgy
          14 Posts
          ACCEPTED ANSWER

          Re: DXL Dialog resizeable

          ‏2013-12-03T15:39:41Z  in response to pommCannelle

          Thank you very much. It is working great.

          STB