Menu

#415 oodialog 4.2 editcontrol setcue

ooDialog.4.2.0
closed
ooDialog (102)
5
2012-08-27
2011-01-13
hex
No

Using rc file created with ResEdit 1.5.4 and an edit control like this (ES_UPPERCASE)
EDITTEXT IDC_USERID, 20, 172, 66, 12, ES_AUTOHSCROLL | ES_UPPERCASE
and then in the dialog use method setcue("Enter Userid") on this editcontrol the setcue text will also be displayed in uppercase
Is it possible to get the setcue text as defined and still display user input in the editcontrol in uppercase ?
I.e I want to display entered input in uppercase but setcue text in mixed case.

Open Object Rexx Version 4.2.0
Build date: Jan 12 2011
Addressing Mode: 64
Win 7

Discussion

  • Mark Miesfeld

    Mark Miesfeld - 2011-01-13

    Off of the top of my head I don't think this is possible. If you are using exactly "Enter Userid" for you argument to the setCue() method, then the underlying edit control is what is changing the text, not the ooDialog framework.

    There is probably no way to change this. At least I don't see any way.

    You might be able to do something like this:

    Remove the ES_UPPERCASE from the .rc definition.

    connect the GOTFOCUS and LOSTFOCUS edit control events to methods in you dialog.

    set your cue in initdialog

    In you event handler for the GOTFOCUS event handler add the UPPERCASE style to the edit control. In your LOSTFOCUS event handler remove the UPPERCASE style again.

    This might work if you play with it a little, but I can't be sure.

    I'll do a little more research and see if there is some other approach.

     
  • hex

    hex - 2011-01-13

    Comparing with the login in win7, even if the focus is on the password field the setcue text is showing until you types something in.
    In ooDialog the setcue text disappears as soon as the editcontrol get the focus, it would be good if the text is shown until something is typed in the field, this will not of course solve the problem with upper/lower case.

     
  • Mark Miesfeld

    Mark Miesfeld - 2011-01-14

    1.) I do not see the behavior you describe concerning the setting of the cue in a ES_UPPERCASE edit control.

    I'm attaching a sample program that works fine for me. It uses a .rc file created by resEdit. The IDC_EDIT_STATE edit control has the upper case style. When I set the cue to 'state', 'state' is what I see. Not 'STATE' The program also has a number only edit control and I can set the cue there to Zip and Zip is what shows.

    Now, this is on XP. It may be that the behavior is different on Windows 7. If so, then there is nothing that ooDialog can do about it.

    2.) Your point about the focus is good. There is a now a second parameter in the underlying Windows API that controls if the cue disappears when the edit control gets the focus or if it disappears when the user first types a character. That parameter was not present when I first wrote the setCue method.

    I've added a second optional parameter to the setCue method to use this. When set to .true, the cue text will not disappear until the user types a character. When set to .false, the default, the text will disappear when the edit control gets the focus.

    Unfortunately this does not work on XP, but I bet it works on Vista or later.

    I will test this on Windows 7 tonight, or as soon as I get a chance.

    Thanks for bringing this up.

     
  • Mark Miesfeld

    Mark Miesfeld - 2011-01-14

    Example program showing lower case cue

     
  • hex

    hex - 2011-01-14

    You are correct about the behaviour of setcue, in xp it works, but not in WIN7 (at least not for me)

     

Anonymous
Anonymous

Add attachments
Cancel