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 

MonthCal control with multi-select option - GUI ugliness

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



Joined: 16 Dec 2007
Posts: 48

PostPosted: Sun Oct 05, 2008 4:51 am    Post subject: MonthCal control with multi-select option - GUI ugliness Reply with quote

Code:
Gui, Add, MonthCal, multi vMyCalendar gdocalendar
Gui, Add, Text, w200, Calendar info:
Gui, Add, Edit, +readonly vcalendarinfo w200
Gui, Show
return

GuiClose:
exitapp

docalendar:
    GuiControl, , calendarinfo, %MyCalendar%
return


The "multi" option is supposed to allow for date ranges to be selected from a MonthCal control. When I run this script on XP, the 'range' behavior is very ugly:

one day selected:


a range selected


Is there a way to make it not look like that?
(fwiw, i'm on XP)
Back to top
View user's profile Send private message
Guest






PostPosted: Sun Oct 05, 2008 6:04 am    Post subject: Re: MonthCal control with multi-select option - GUI ugliness Reply with quote

I have had similar problems with the datetime control being nearly unreadable depending on the windows system colors selected. I found that by setting datetime styles, the datetime control can be made very readable on any system. See this link for datetime styles.

Code:
; add an appropriate 'style' sendmessage just before adding the datetime control.
; for example:
SendMessage, 0x1006, 2, 0xc0c0c0, SysDateTimePick321 ;MCSC_TITLEBK = 2.
Gui, Add, MonthCal,multi vMyCalendar gdocalendar


pokercurious wrote:

Is there a way to make it not look like that?
(fwiw, i'm on XP)
Back to top
OceanMachine



Joined: 15 Oct 2007
Posts: 780
Location: England

PostPosted: Thu Mar 11, 2010 7:41 pm    Post subject: Re: MonthCal control with multi-select option - GUI ugliness Reply with quote

pokercurious wrote:
The "multi" option is supposed to allow for date ranges to be selected from a MonthCal control. When I run this script on XP, the 'range' behavior is very ugly: ...
Is there a way to make it not look like that?
(fwiw, i'm on XP)


Well, I know this is an old post, but I just ran into the same issue. And it seems you are using the same theme as me, so I thought it might be related to the theme... but I just switched to the Windows XP default theme, and the same thing happens.

As you discovered, the control still works, but it's the actual dates that are selected that have problems with the text colours.

So anyway, in case anyone else stumbles across this thread, I found a way to change that text colour to something that is OK (but change the colour to something more suitable if you prefer).

The below is what I did - the important bits are in red. make sure you use SendMessage after the control has been added to the Gui (but it can be done before you show the GUI if you like.

Code:
#NoEnv
Gui, Add, MonthCal, vSelectedDates Multi
Gui, +LastFound
SendMessage, 0x100A, 3, 0x009ACC, SysMonthCal321   ; 0x100A is MCM_SETCOLOR
                                                   ; 3 is MCSC_TITLETEXT (for title text and text of selected dates)
                                                   ; 0x009ACC is kind of orange colour to change the text to. (BBGGRR format)
Gui, Add, Button, , Tell Me ; just for testing
Gui, Show
Return

ButtonTellMe:
   GuiControlGet, SelectedDates
   MsgBox, Selected Dates : %SelectedDates%
Return

GuiClose:
GuiEscape:
   ExitApp
Return



Note: The previous answer (by Guest) is for DateTime controls, not MonthCal controls as was asked, but it was relevant as this is what fixed the issue with the MonthCal control.

In case you wanted to change the other colours, you can do so by using the following for the second parameter of SendMessage:

Code:

SendMessage, 0x100A, X, 0x009ACC ; 0x009ACC is the colour

; change X for one of the following:
; 1 is the text of the currently displayed month's dates when they are not selected
; 2 is title background and background of individual selected dates
; 3 is the title month text and text of selected dates
; 4 is the overall background of the control
; 5 is the text of the dates that are outside the month that is being displayed
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