Jump to content

Advanced Input Box


matwachich
 Share

Recommended Posts

  • 5 months later...

Very good, thanks for sharing.

I have always thought I should do something with my two Dialog programs, to combine them as one, with added features to be fully featured.

Currently I have one program that creates a MsgBox, providing all the options for the standard AutoIt variations. It has a preview option of course, as well as an option to create a simple error dialog with one click. The other program is a viewer (and text editor), for when you may want to change or preview textual changes of a MsgBox. It will import the settings and export them, but currently doesn't provide a dynamic way to change anything other than typing (plus copy & paste) the text.

That said, maybe someone has already done that here .... I've not looked in a good long while, and no longer keep tabs on the Examples section like I once used to.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

  • 2 months later...

This is really one of the best libraries in whole forum, I think.

 

There is just one mistake, in my opinion:
In line 464 of , I would await

...
                $vTmp = __advInputBox_objGet($aControls[$i], "selected", -1)    ; "selected" instead of "value"

 

Greetings from Germany

Patrick

Link to comment
Share on other sites

Hi and thanks :)

See documentation of combo field

{
  type:  "combo"
  id:    "name" (must be unique, without spaces)
  label: "label text"

  optionals:
  ----------
  options: ["option0", "option1" ...]
  value: 0|1|...|N OR "option0"|"option1"|...|"optionN"

  margin
  style, exstyle, color, bkcolor, font
  labelStyle, labelExStyle, labelColor, labelBkColor, labelFont
}

I named it "value" (not "selected"). This is to be consistent with other fields.

Same thing for list field.

Link to comment
Share on other sites

Yeaaaah, but.....
Using "value" (and the corresponding original line 464 in your code) seems to ADD e.g. the string "0" to the list and selects it.... 😐

Changing your code to "selected" seems to work as expected - at least for me!

Or do I use an old version of your library? I will check this...

 

Thanks for your quick response,

Patrick

 

Link to comment
Share on other sites

Changing your example 2 shows what I mean:

; All controls
Func Example2()
;    Local $sJSON = '{ title:"Showcase" font:[10, 600, 0, "Calibri"] controls:[' & _
    Local $sJSON = '{ title:"Showcase" controls:[' & _
        '{type:"label", text:"Enter you personal informations (please :p)"},' & _
        '{type:"input", id:"firstname", label:"First name"},' & _
        '{type:"input", id:"lastname", label:"Last name"},' & _
        '{type:"combo", id:"sex", label:"Sex", options:["Male", "Female"], value:0 selected:-1},' & _ ; selected = 0 for male, = 1 for female ; or you can use the exact same string as in options "Male" or "Female"
        '{type:"date", id:"dob", label:"Date of birth", value:"2020/01/01", style:0},' & _ ; $DTS_SHORTDATEFORMAT
        '{type:"separator"},' & _
        '{type:"edit", id:"address", label:"Address", lines:5},' & _
        '{type:"list", id:"options", label:"Options", options:["First", "Second", "Third"], selected:["First"]}' & _
        '{type:"label" text:"I agree to share my personnal informations with big brother:"}' & _
        '{type:"check", id:"agree", label:"Yes", value:true}' & _
    ']}'

    Local $oRet = advInputBox($sJSON)
    If @error Then
        MsgBox(64, "Example1", "Dialog canceled")
    Else
        MsgBox(64, "Example1", "Return: " & Json_Encode($oRet, 128))
    EndIf
EndFunc

I guessed "value" being an error because you used "selected" there, but it didn't work.

 

Greetings
Patrick

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...