AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GUI: ReadOnly Edit... possible to customize?

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
delta



Joined: 16 Feb 2005
Posts: 44

PostPosted: Wed Aug 24, 2005 10:52 pm    Post subject: GUI: ReadOnly Edit... possible to customize? Reply with quote

Is it possible to have a read only Edit box with white background (well, other than setting the whole background white)? Also, when I change the text in the Edit control via GuiControl it is always completely selected? Confused

Hm, what do you use to display a lot of text? Even if you are happy with a gray-backgrounded readonly Edit control, there's still the problem, that the text it selected after posting it to the control and also, that is it scrolled down. Well, you could send ^{Home} for that, but it is really the only way?

Well, I also did it with ControlSetText which yields unselected text which is not scrolled down. But that seems an eerie way to me. Like if you go from the kitchen to the living room by leaving through the kitchen room window and reentering through the living room window. Laughing
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Thu Aug 25, 2005 12:05 am    Post subject: Re: GUI: ReadOnly Edit... possible to customize? Reply with quote

delta wrote:
Is it possible to have a read only Edit box with white background (well, other than setting the whole background white)?
I don't know of any easy way, but it's on the to-do list to allow custom background colors for individual controls.

Quote:
Also, when I change the text in the Edit control via GuiControl it is always completely selected?
I think the select-all behavior results from navigating/focusing the control rather than using GuiControl. I tested GuiControl to insert new text while an Edit has focus and it didn't cause select-all. But I could be missing something.

Quote:
...the text it selected after posting it to the control and also, that is it scrolled down. Well, you could send ^{Home} for that, but it is really the only way?
There are a lot of messages you can send to an Edit control and I'm not well versed in them yet. In case you need it, here is one that sets the caret position to the top of the control:

Gui +LastFound
SendMessage, 0xB1, 0, 0, Edit1 ; 0xB1 is EM_SETSEL. The first 0 is selection's start pos. and the second is end pos.

Thanks for this feedback about the Edit control. At the very least, I think the documentation needs to be improved about how to set selections, caret positions, etc. But some more built-in functionality would probably be good too.
Back to top
View user's profile Send private message Send e-mail
delta



Joined: 16 Feb 2005
Posts: 44

PostPosted: Thu Aug 25, 2005 1:35 pm    Post subject: Reply with quote

Thanks, I was beginning to wonder about how to set the caret position! Wink

I'm looking forward to new versions for more customization. Smile Hm, will it ever be possible to change the font for single words in ReadOnly edit boxes? Or at least the style or color... something like "After all this <b>is</b> a bold word."? And can this also be extended to tool tips?

But any way: You are doing a great job, Chris! Very Happy
(Has to be said every now and then!)
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Fri Aug 26, 2005 1:12 am    Post subject: Reply with quote

delta wrote:
...will it ever be possible to change the font for single words in ReadOnly edit boxes?
I don't think so because Edit controls (which are a built-in feature of the OS) don't support it. However, there will probably be a RichEdit control someday, which might offer these capabilities.

Quote:
And can this also be extended to tool tips?
It seems unlikely because a ToolTip's appearance is controlled and standardized by the OS.
Back to top
View user's profile Send private message Send e-mail
Rhys



Joined: 17 Apr 2007
Posts: 761
Location: Florida

PostPosted: Wed Mar 26, 2008 8:36 pm    Post subject: Re: GUI: ReadOnly Edit... possible to customize? Reply with quote

delta wrote:
Is it possible to have a read only Edit box with white background (well, other than setting the whole background white)?

Bump... Is this possible? Custom control colors seem to be overridden by +Readonly... I'm using a light grey color for my background as a workaround, but the white edit box (without +Readonly) looks much nicer on a grey background.
_________________
[Join IRC!]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group