Hi,
is there a chance to retrieve the State of a CalendarGadget by LeftDoubleClicking on a date on the CalendarGadget?
Has anyone an idea, please?
Thank you
Marco
CalendarGadget and EventType?
CalendarGadget and EventType?
PureBasic for Windows
Is this what you are after ?
Code: Select all
#MCN_SELECT = #MCN_FIRST + 4
Global gOldProc, gBlnSelected
Procedure calProc(hWnd, uMsg, wParam, lParam)
Protected result, selDate
Static dateBeforeClick, dateAfterClick
Select uMsg
Case #WM_LBUTTONDBLCLK
result = CallWindowProc_(gOldProc, hWnd, uMsg, wParam, lParam)
If gBlnSelected
selDate = GetGadgetState(0)
Debug "New date selected through double-click : " + FormatDate("%dd/%mm/%yyyy", selDate)
gBlnSelected = #False
EndIf
Default
result = CallWindowProc_(gOldProc, hWnd, uMsg, wParam, lParam)
EndSelect
ProcedureReturn result
EndProcedure
Procedure WinCallback(hwnd, msg, wparam, lparam)
Protected result = #PB_ProcessPureBasicEvents
Select msg
Case #WM_NOTIFY
*pnmh.NMHDR = lparam
If *pnmh\hwndFrom = GadgetID(0)
Select *pnmh\code
Case #MCN_SELECT
gBlnSelected = #True
EndSelect
EndIf
EndSelect
ProcedureReturn result
EndProcedure
If OpenWindow(0, 0, 0, 220, 280, "", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
CalendarGadget(0, 10, 10, 200, 180)
SetClassLong_(GadgetID(0), #GCL_STYLE, GetClassLong_(GadgetID(0), #GCL_STYLE)!#CS_DBLCLKS)
gOldProc = SetWindowLong_(GadgetID(0), #GWL_WNDPROC, @calProc())
SetWindowCallback(@WinCallback())
Repeat
event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
EndIf
I may look like a mule, but I'm not a complete ass.
Re: CalendarGadget and EventType?
What's wrong with GetGadgetState?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
It`s like a DateRequester: The Calendargadget pops up in a seperate window (click on '...'), when using #nxPropertyBox_CustomTextDialog from nxProperty...
I did it with GetGadgetState...but then I have to click first on the date and then close the window by extra-clicking on X. A double-click is much better and usual
I didn`t have a better idea, how to do this.
I did it with GetGadgetState...but then I have to click first on the date and then close the window by extra-clicking on X. A double-click is much better and usual

I didn`t have a better idea, how to do this.
PureBasic for Windows
Fluid Byte already posted a code example in the German forum in September 2008: 
http://www.purebasic.fr/german/viewtopi ... 92&start=4

http://www.purebasic.fr/german/viewtopi ... 92&start=4
I am a professional programmer who looks into the PB forums only during his working hours (if time allows)Marco2007 wrote:...and why didn`t you tell me on Sat May 30?
but normally not during weekends...

A search with only "calendargadget" in the German forum would have shown Fluid Byte's posting as the 4th entry...Marco2007 wrote:OF course, I´ve searched on the German board, too -> but always "Calendargadget" with the wrong word... I just had to use "klick" instead of "click"...
But if the forum search doesn't deliver the wanted results it's always worthwhile to try a Google search with the site parameter:
"calendargadget site:http://www.purebasic.fr"
(Thank you PB for this hint in a previous thread

Using this approach you are also searching through German and French forums and the Google search is more reliable than the forum search.
Yeah, I found out yesterday...I thought, searching only for calendargadget will display too many results...Shardik wrote:A search with only "calendargadget" in the German forum would have shown Fluid Byte's posting as the 4th entry....
Good to know and thanx!Shardik wrote: worthwhile to try a Google search with the site parameter:
"calendargadget site:http://www.purebasic.fr"

forum sites are banned, where I workShardik wrote:...who looks into the PB forums only during his working hours (if time allows)

PureBasic for Windows