Sign in to follow this  
Followers 0
ioliver

Combo Box In Gui

17 posts in this topic

I'm working with a Combo Box in my GUI Script.

Opt("GUINotifyMode", 1)
GUICreate("TxtMsg / Blat messages to mobile phones", 300, 200)
  GUISetControl("Label", "Address (phone number@provider address):", 10, 10)
  $address = GUISetControl("Combo", "1235556789@mobile.mycingular.net", 10, 25, 280)
  $abook = FileReadLine("C:\TxtMsg\ABook.txt", 1)
  GUISetControlData($abook, $abook)
  GUISetControl("Label", "Subject:", 10, 60)
  $subj = GUISetControl("Input", "Type your subject here", 10, 75, 280)
  GUISetControl("Label", "Message:", 10, 110)
  $msg = GUISetControl("Input", "Type your message here", 10, 125, 280)
  $blat = GUISetControl("Button", "Send", 10, 160, 100)
  $quit = GUISetControl("Button", "Exit", 190, 160, 100)
GUIShow()

In the Line $abook = FileReadLine("C:\TxtMsg\Abook.txt", 1) Abook.txt is a a Text file with only one line containing data seperated by a "|". But it dosen't populate my Combo box at Run Time.

Any Idea?

Thanks,

Ian

Ohh, I don't think I understand the controlref...


"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Share this post


Link to post
Share on other sites



I'm working with a Combo Box in my GUI Script.

[in the Line $abook = FileReadLine("C:\TxtMsg\Abook.txt", 1) Abook.txt is a a Text file with only one line containing data seperated by a "|".  But it dosen't populate my Combo box at Run Time.

Any Idea?

Thanks,

Ian

Ohh, I don't think I understand the controlref...

<{POST_SNAPBACK}>

:ph34r: Should this line:

GUISetControlData($abook, $abook)

Be

GUISetControlData($address , $abook)


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Should this line:

GUISetControlData($abook, $abook)

Be

GUISetControlData($address , $abook)

You're right about that. Somtimes I miss the simple things.

But it still dosen't work. And I even tried changing the second $abook to some static data. (Ex. "Item1|Item2")

$address = GUISetControl("Combo", "1235556789@mobile.mycingular.net", 10, 25, 280)
  $abook = FileReadLine("C:\TxtMsg\ABook.txt", 1)
  GUISetControlData($address, "Item1|Item2")

"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Share this post


Link to post
Share on other sites

Works fine for me.... it only doesn't showa default value since thats not specified....

try this one:

GUICreate("TxtMsg / Blat messages to mobile phones", 300, 200)
GUISetControl("Label", "Address (phone number@provider address):", 10, 10)
$address = GUISetControl("Combo", "1235556789@mobile.mycingular.net", 10, 25, 280)
GUISetControlData($address, "Item1|Item2","Item1")
GuiShow()
GUIWaitClose()

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I set the default Item (GUISetControlData($address, "Item1|Item2","Item1")). Now the Combo Box displays "Item1" but it still dosen't have a any more items listed in the Drop-down box.


"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Share this post


Link to post
Share on other sites

I set the default Item (GUISetControlData($address, "Item1|Item2","Item1")).  Now the Combo Box displays "Item1" but it still dosen't have a any more items listed in the Drop-down box.

<{POST_SNAPBACK}>

Are you running 98? if so try setting the height of the combo box to 80..

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Windows 2000


"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Share this post


Link to post
Share on other sites

Windows 2000

<{POST_SNAPBACK}>

Well i am running xp and it work fine ... are you just runnin the script i posted or the one you posted with changes??

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thanks for all your help.

Here is my whole script:

Opt("GUINotifyMode", 1)
GUICreate("TxtMsg / Blat messages to mobile phones", 300, 200)
  GUISetControl("Label", "Address (phone number@provider address):", 10, 10)
  $address = GUISetControl("Combo", "1235556789@mobile.mycingular.net", 10, 25, 280)
  $abook = FileReadLine("C:\TxtMsg\ABook.txt", 1)
  GUISetControlData($address, "Item1|Item2", "Item1")
  GUISetControl("Label", "Subject:", 10, 60)
  $subj = GUISetControl("Input", "Type your subject here", 10, 75, 280)
  GUISetControl("Label", "Message:", 10, 110)
  $msg = GUISetControl("Input", "Type your message here", 10, 125, 280)
  $blat = GUISetControl("Button", "Send", 10, 160, 100)
  $quit = GUISetControl("Button", "Exit", 190, 160, 100)
GUIShow()

While 1
  $x = GuiMsg()

  Select
  Case $x = $blat
    $address1 = GuiRead($address)
    $subj1 = GuiRead($subj)
    $msg1 = GuiRead($msg)
    FileOpen("C:\TxtMsg\Msg.txt", 2)
    FileWrite("C:\TxtMsg\Msg.txt", $msg1)
    RunWait(@ComSpec & " /c " & "blat C:\TxtMsg\Msg.txt -to " & $address1 & " -subject " & $subj1, "", @SW_HIDE)
    MsgBox(0, "TxtMsg / Blat messages to mobile phones", "Message: " & $msg1 & " Sent to User: " & $address1)

  Case $x = $quit
    Exit
  EndSelect
WEnd

"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Ahhh.. think i know what the problem is...

The Label above the bombo box is overlaying it ... try it with thee lines:

GUISetControl("Label", "Address (phone number@provider address):", 10, 10)

$address = GUISetControl("Combo", "1235556789@mobile.mycingular.net", 10, 35, 280)

:ph34r:

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Thanks again JdeB, But that still didn't do it.

You just wanted be to change the "25" to a "35" in the line: $address = GUISetControl("Combo", "1235556789@mobile.mycingular.net", 10, 35, 280)

I tried that but my combo box still dosen't have any options in it...

Thanks again,

Ian

-> I thought that the Combo Box might not have enough room to expand b/c the of the controls below it, so I tried moving them all down by "100" but that didn't help either. Just thought I'd add that. It looks like the CB just isn't accepting the data.

Edited by ioliver

"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Share this post


Link to post
Share on other sites

Thanks again JdeB, But that still didn't do it.

You just wanted be to change the "25" to a "35" in the line: $address = GUISetControl("Combo", "1235556789@mobile.mycingular.net", 10, 35, 280)

I tried that but my combo box still dosen't have any options in it...

Thanks again,

Ian

<{POST_SNAPBACK}>

:ph34r: you mean it doesn't dropdown when clicking the right arrow of the combobox?? ... did you try the down arrow to see if they are there ???

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

I hadn't tried the (Down Arrow), but I just did and the options are there...

But why won't it drop down?

Thanks again, at least that's progress.

-> And I just tried the FileRead part using the Variable $abook and that's working, still no drop down box. Thanks again.

Edited by ioliver

"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Share this post


Link to post
Share on other sites

I hadn't tried the (Down Arrow), but I just did and the options are there...

But why won't it drop down?

Thanks again, at least that's progress.

<{POST_SNAPBACK}>

Did you ever try the suggestion i made to set the height of the combo box?

I know its an issue on win9X..... maybe also on Win2K ....


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Setting the height to "80" works, but everyting on the form gets pushed down.

Here's the new code if you want to try it:

Opt("GUINotifyMode", 1)
GUICreate("TxtMsg / Blat messages to mobile phones", 300, 200)
  GUISetControl("Label", "Address (phone number@provider address):", 10, 10)
  $address = GUISetControl("Combo", "1235556789@mobile.mycingular.net", 10, 25, 280, 80)
  $abook = FileReadLine("C:\TxtMsg\ABook.txt", 1)
  GUISetControlData($address, $abook)
  GUISetControl("Label", "Subject:", 10, 60)
  $subj = GUISetControl("Input", "Type your subject here", 10, 75, 280)
  GUISetControl("Label", "Message:", 10, 110)
  $msg = GUISetControl("Input", "Type your message here", 10, 125, 280)
  $blat = GUISetControl("Button", "Send", 10, 160, 100)
  $quit = GUISetControl("Button", "Exit", 190, 160, 100)
GUIShow()

While 1
  $x = GuiMsg()

  Select
  Case $x = $blat
    $address1 = GuiRead($address)
    $subj1 = GuiRead($subj)
    $msg1 = GuiRead($msg)
    FileOpen("C:\TxtMsg\Msg.txt", 2)
    FileWrite("C:\TxtMsg\Msg.txt", $msg1)
    RunWait(@ComSpec & " /c " & "blat C:\TxtMsg\Msg.txt -to " & $address1 & " -subject " & $subj1, "", @SW_HIDE)
    MsgBox(0, "TxtMsg / Blat messages to mobile phones", "Message: " & $msg1 & " Sent to User: " & $address1)

  Case $x = $quit
    Exit
  EndSelect
WEnd

Thanks,

Ian


"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Share this post


Link to post
Share on other sites

Setting the height to "80" works, but everyting on the form gets pushed down.

<{POST_SNAPBACK}>

From the helpfile: [height] The height of the control (default is the previous used height).

So add a Height to the next one of 20 like:

$address = GUISetControl("Combo", "1235556789@mobile.mycingular.net", 10, 25, 280, 80)
  $abook = FileReadLine("C:\TxtMsg\ABook.txt", 1)
  GUISetControlData($address, $abook)
  GUISetControl("Label", "Subject:", 10, 60,-1,20)

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thanks alot, you're a genius.

I appericate all the help.

We'll I'm off work. Hope you have a great afternoon.

Ian


"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Share this post


Link to post
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
Sign in to follow this  
Followers 0