Topic
  • 4 replies
  • Latest Post - ‏2012-04-27T04:14:30Z by MF2G_qaus_qazah
MF2G_qaus_qazah
MF2G_qaus_qazah
20 Posts

Pinned topic Frames in Dialog Boxes

‏2012-04-26T06:29:30Z |
Can anybody tell me how can I place two frames in a Dialog Box.Please tell me what is the problem in this code:

Module mod = current Module
int noOfAttrs = 0
string attrNames50
string valToSearch = ""
string an = ""
string newModName=""
Skip skpObjsFound=create
Object o=null
int x=0
int i=0
int& numTotalObjs=x
string searchOptions[]={"Module","Project"}
string searchAttr[]={"Object Text","Object Heading","Object Text and Heading"}

for an in attributes(mod) do
{
attrNamesnoOfAttrs++=an
terminator=noOfAttrs+2
attrNamesterminator="999"
}

DB reqBox = create "Search Dialog"
DBE theFrame1, theFrame2, theFrame3
DBE txtValue = field(reqBox,"Find what : " , "" , 40, false)
DBE rbSearch= verticalRadioBox(reqBox,"Search For : " , searchAttr,0)
theFrame1 = frame(reqBox, "Find In", 85, 150)
theFrame1->"top"->"form"
theFrame1->"left"->"form"
theFrame1->"right"->"form"
txtValue->"top"->"spaced"->theFrame1
rbSearch->"bottom"->"spaced"->theFrame1
below reqBox
theFrame2=frame(reqBox, "Module Properties",85,200)
DBE txtModName=field(reqBox,"New Module Name: " , "" ,40,false)
DBE selected_VWAttrs=multiList(reqBox,"Select Attributes to be Included in New Module View...",5,attrNames,noOfAttrs)
theFrame2->"top"->"spaced"->theFrame1
txtModName->"left"->"inside"->theFrame2
selected_VWAttrs->"top"->"spaced"->txtModName
//selected_VWAttrs->"bottom"->"spaced"->theFrame2
below reqBox
DBE radioChoice=radioBox(reqBox,"Search In : " , searchOptions,1)

void accept(DB reqBox)
{ //search Functionality implemented }
ok(reqBox, "Search", accept)
show reqBox

The resulting Dialog appears as attached image(dialog.png)

I want to place "New Module Name" and "Attributes multiList" inside "theFrame2" Please tell me how can I do that .I have made so many hidden and logical trials.
Updated on 2012-04-27T04:14:30Z at 2012-04-27T04:14:30Z by MF2G_qaus_qazah
  • Martin_Hunter
    Martin_Hunter
    46 Posts

    Re: Frames in Dialog Boxes

    ‏2012-04-26T14:46:42Z  

    I think all you need to change is
    txtModName->"left"->"inside"->theFrame2
    to
    txtModName->"top"->"inside"->theFrame2
    since you want txtModName inside the top of theFrame2

    In future post your code inbetween {co de} statements (no space)
    ie

    txtModName->"left"->"inside"->theFrame2
    // should be
    txtModName->"top"->"inside"->theFrame2
    

     


    Martin

     

    Updated on 2014-01-06T20:40:23Z at 2014-01-06T20:40:23Z by iron-man
  • Martin_Hunter
    Martin_Hunter
    46 Posts

    Re: Frames in Dialog Boxes

    ‏2012-04-26T14:53:13Z  

    I think all you need to change is
    txtModName->"left"->"inside"->theFrame2
    to
    txtModName->"top"->"inside"->theFrame2
    since you want txtModName inside the top of theFrame2

    In future post your code inbetween {co de} statements (no space)
    ie

    <pre class="javascript dw" data-editor-lang="js" data-pbcklang="javascript" dir="ltr">txtModName->"left"->"inside"->theFrame2 // should be txtModName->"top"->"inside"->theFrame2 </pre>

     


    Martin

     

    One final observation, are you sure you want to use 'multiList' rather than 'list' for your searchAttr.

    Martin
  • llandale
    llandale
    3035 Posts

    Re: Frames in Dialog Boxes

    ‏2012-04-26T17:53:28Z  

    This works:

    Module mod = current Module
    int noOfAttrs = 0
    string attrNames[50]
    string valToSearch = ""
    string an = "" 
    string newModName=""
    Skip skpObjsFound=create
    Object o=null
    int x=0
    int i=0
    int& numTotalObjs=x
    string searchOptions[]={"Module","Project"}
    string searchAttr[]={"Object Text","Object Heading","Object Text and Heading"}
    int    terminator = 0
     
     
    for an in attributes(mod) do
    {
            attrNames[noOfAttrs++] = an
            terminator=noOfAttrs+2
            attrNames[terminator]="999"
    }
     
    DB reqBox = create "Search Dialog"
    DBE theFrame1, theFrame2, theFrame3
    theFrame1 = frame(reqBox, "Find In", 1,1)
    DBE txtValue = field(reqBox,"Find what : " , "" , 40, false)
    DBE rbSearch= verticalRadioBox(reqBox,"Search For : " , searchAttr,0)
            theFrame1->"top"->"form"
            theFrame1->"left"->"form"
            theFrame1->"right"->"form"
            txtValue->"top"->"inside"->theFrame1
            txtValue->"left"->"inside"->theFrame1
            rbSearch->"bottom"->"inside"->theFrame1
    below reqBox
     
    theFrame2=frame(reqBox, "Module Properties",1,1)
    DBE txtModName=field(reqBox,"New Module Name: " , "" ,40,false)
    DBE selected_VWAttrs=multiList(reqBox,"Select Attributes to be Included in New Module View...",5,attrNames,noOfAttrs)
    below reqBox
    DBE radioChoice=radioBox(reqBox,"Search In : " , searchOptions,1)
            theFrame2->"top"->"spaced"->theFrame1
            txtModName->"left"->"inside"->theFrame2
            txtModName->"top"->"inside"->theFrame2
            selected_VWAttrs->"top"->"spaced"->txtModName
            //selected_VWAttrs->"bottom"->"spaced"->theFrame2
    //      radioChoice ->"top"        ->"flush"  ->selected_VWAttrs
            radioChoice     ->"bottom" ->"inside" ->theFrame2
     
    DBE stupid = label(reqBox, "")
            stupid  ->"top"    ->"flush"  ->theFrame2
     
    void accept(DB reqBox) 
    { //search Functionality implemented 
    } 
    ok(reqBox, "Search", accept)
    show reqBox
    


    This is what I did, perhaps its not all necissary:

     

    • The frames are defined before its elements, at size 1,1
    • All the elements of a frame are arranged vis-a-vis the 1st element.
    • The first element has top and left inside the frame.
    • The last element has bottom inside the frame.
    • Sometimes you have to define a right inside the frame.
    • The frame itself is positioned, in this case vis-a-vis the other frame
    • You need a stupid DBE under the last frame in order that the "apply" dialog row positions correctly.


    -Louie

     

    Updated on 2014-01-06T20:41:00Z at 2014-01-06T20:41:00Z by iron-man
  • MF2G_qaus_qazah
    MF2G_qaus_qazah
    20 Posts

    Re: Frames in Dialog Boxes

    ‏2012-04-27T04:14:30Z  
    Thanx to both of you for your prompt reply