AutoHotkey Community

It is currently May 27th, 2012, 11:53 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: November 8th, 2005, 12:50 am 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
I have no luck with setting these:
Code:
Gui Color,00FF00,FFFF00
Gui font, Times New Roman Bold cFF0000 S14
Gui Add, DateTime, w169
Gui Show, w300
I wanted to put the GUI on top of another window, and it would be nice if the DateTime control blended in. However, the colors and font settings have no effect.

Also, an option was nice, which removes the drop down calendar triangle and instead a click in the DateTime control would activate the calendar – or the g-label, without having to actually change the date or time in the box.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 8th, 2005, 2:11 am 
Offline

Joined: September 25th, 2005, 4:31 pm
Posts: 610
To change the font try:

note: apparently, the c option only affects the dates on the drop-down month calendar component of the control.

Code:
Gui, font, cFF0000 S14, Times New Roman Bold


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 8th, 2005, 8:26 am 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
You are right, with separation the font name works, but not the colors.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 8th, 2005, 1:50 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
I don't think there's a way to customize the font color in a DateTime control without overriding parts of the control's code. Although this is possible, it has a relatively high R&D cost with relatively low benefit. Therefore, it seems to score low in priority.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 8th, 2005, 3:36 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Is there a SendMessage or DllCall workaround?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 9th, 2005, 2:29 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Assuming that this would require overriding the DateTime control's WindowProc -- which is a callback function that must exist in the code itself -- it's my guess that there isn't a way to do it in the script. I've also checked MSDN DateTime page but there doesn't seem to be any built-in way to customize the color.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 10th, 2005, 2:01 am 
Offline

Joined: September 25th, 2005, 4:31 pm
Posts: 610
If the standard control does not meet your needs...

maybe a custom control will (the window should not be moved during this demonstration). There are many ways to create a custom control, but the method demonstrated takes advantage of existing capabilities as much as possible.

Code:
Gui, Color, 00FF00, FFFF00
Gui, Font, cFF0000 s14, Times New Roman Bold
Gui, Add, DateTime, x5 y5
Gui, Add, Edit, x5 y45 w120 h30 ReadOnly vControl_DateTime, 11/  9/2005
Gui, Show, x10 y10

Gui, 2:+AlwaysOnTop -Caption +Owner1
Gui, 2:Add, MonthCal, x0 y0

WM_LBUTTONDOWN = 0x201
OnMessage( WM_LBUTTONDOWN, "HandleMessage" )
return

HandleMessage( p_w, p_l, p_m, p_hw )
{
   global   WM_LBUTTONDOWN
   static   IsMonthCal_Visible
   
   if ( p_m = WM_LBUTTONDOWN )
   {
      if ( A_GuiControl = "Control_DateTime" )
      {
         if IsMonthCal_Visible=
         {
            x := 10+5+10
            y := 10+45+30+25
         
            Gui, 2:Show, x%x% y%y% w176 h153
            
            IsMonthCal_Visible := true
         }
         else
         {
            Gui, 2:Hide
            
            IsMonthCal_Visible=
         }
            
      }
   }
}

GuiClose:
ExitApp

F12::
Reload


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group