Jump to content

GuiSetState = Readonly and Centered


Recommended Posts

Never played around with it before, but maby, @SW_DISABLE

[quote name='DaleHohm']You have a strange habit of posting error messages that don't match your code.[/quote][quote name='SmOke_N']Forget the learning... straight to the scripting :lol: (laugh.gif)[/quote]

Link to comment
Share on other sites

  • Moderators

You really need to look at GUICtrlSetState() for centering and such, everything else is done by hand in the GUI itself. Also look at the $ES_READONLY style and $SS_CENTER / $ES_CENTER in the GUI Control Styles that I've told you look at before :whistle: .

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

You really need to look at GUICtrlSetState() for centering and such, everything else is done by hand in the GUI itself. Also look at the $ES_READONLY style and $SS_CENTER / $ES_CENTER in the GUI Control Styles that I've told you look at before :whistle: .

Sorry I worded that wrong. It's not GuiSetState I want to look at, I want to apply it to a editbox. I've already used the $ss_center and the $es_readonly for other boxes. However the box that has $es_readonly doesn't look good because the text is directly in the top left of the Editbox. That's why I was wondering if there's a way to combine them.

Thanks, Piano_Man

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

  • Moderators

BitOr($ES_READONLY, $ES_CENTER)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

BitOr($ES_READONLY, $ES_CENTER)

Hmm, well sorry but that doesn't help me. I haven't used and Bit stuff yet... If you would like to show me here's the script that's relevant... I want the one edit box that I have to be centered/read only.

#include <GUIConstants.au3>
GUICreate("   Photo Resizing", 460, 160, -1, -1, $WS_CAPTION, $WS_EX_TOOLWINDOW)
GUISetBkColor (0xA29CFE)
$Foldername = "C:\Documents and Settings\test\My Documents\My Pictures\Resizing"
GuiCtrlCreateLabel("Insert how many pictures you want resized and then insert the percentage of the new picture compared to the old picture. You can also chose which folder the program gets pictures from.", 10, 5, 445, 30 )
$exit = GuiCtrlCreateButton("Exit", 235, 110, 90, 30)
GuiCtrlCreateButton("OK", 350, 110, 90, 30)
GUICtrlCreateEdit($Foldername, 10,  45, 405, 15, $ES_Readonly,$WS_EX_STATICEDGE) ;this is where I want to add in the $es_center.
GUISetState(@SW_Show)
While 1
    $msg = GuiGetMSg()
    Select
            Case $msg = $exit
                Exit
    Endselect
Wend

Thanks, Piano_Man

Edited by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

  • Moderators

Hmm, well sorry but that doesn't help me. I haven't used and Bit stuff yet... If you would like to show me here's the script that's relevant... I want the one edit box that I have to be centered/read only.

Sometimes you have to help yourself... You asked how do you combine the two, I showed how to do that, and you made NO effort to even put it in there.

Blah... just put what I gave you where you have $ES_READONLY at now!! :whistle:

Edit:

#include <GUIConstants.au3>
GUICreate("   Photo Resizing", 460, 160, -1, -1, $WS_CAPTION, $WS_EX_TOOLWINDOW)
GUISetBkColor (0xA29CFE)
$Foldername = "C:\Documents and Settings\test\My Documents\My Pictures\Resizing"
GuiCtrlCreateLabel("Insert how many pictures you want resized and then insert the percentage of the new picture compared to the old picture. You can also chose which folder the program gets pictures from.", 10, 5, 445, 30 )
$exit = GuiCtrlCreateButton("Exit", 235, 110, 90, 30)
GuiCtrlCreateButton("OK", 350, 110, 90, 30)
GUICtrlCreateEdit($Foldername, 10,  45, 405, 15, BitOr($ES_READONLY, $ES_CENTER),$WS_EX_STATICEDGE) ;this is where I want to add in the $es_center.
GUISetState(@SW_Show)
While 1
    $msg = GuiGetMSg()
    Select
            Case $msg = $exit
                Exit
    Endselect
Wend
I shouldn't assume anyone has the common sense to take the appropriate actions on a question they asked specifically so I gave you the example. Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...