I am trying to find a way to have the calendar (sysdatatime32) open and stay open on a dialog of its own. I do not want the drop down date to bring it in, but want to call a dialog with just the calendar and two buttons (Save and clear) to set values in the parent dialog. I have no problem with the drop down, but that is not what I want.
Announcement
Collapse
No announcement yet.
sysdatetimepick32 calendar or date only, no dropdown.. how to.
Collapse
X
-
You probably mean SysMonthCal32?:
Code:#Compile Exe #Include "WIN32API.INC" #Include "Commctrl.inc" Function PBMain Local hDlg As Dword, hVal As Dword, icc As INIT_COMMON_CONTROLSEX Icc.dwSize = SizeOf(Icc) Icc.dwIcc = %ICC_STANDARD_CLASSES Or %ICC_DATE_CLASSES InitCommonControlsEx Icc Dialog New 0,"Test",,,200,200,%WS_SYSMENU, To hDlg Control Add "SysMonthCal32", hDlg, 300, "", 30, 40,140,100, %WS_CHILD Or %WS_VISIBLE, %WS_EX_CLIENTEDGE Dialog Show Modal hDlg End Function
Regards,
Peter
"Simplicity is a prerequisite for reliability"
-
Hmmm,
With PB Forms, I just made a dialog with a month calendar and it is ok here.
What version of PB Forms and ehat OS are you using?Last edited by Richard Angell; 22 Sep 2008, 10:13 PM.Rick Angell
Comment
-
1.52 and xp sp3 Here's the code:
Code:CALLBACK FUNCTION ShowCalendar1Proc() SELECT CASE AS LONG CBMSG CASE %WM_INITDIALOG ' Initialization handler DIALOG SET LOC CBHNDL, 15,50 CASE %WM_NCACTIVATE STATIC hWndSaveFocus AS DWORD IF ISFALSE CBWPARAM THEN ' Save control focus hWndSaveFocus = GetFocus() ELSEIF hWndSaveFocus THEN ' Restore control focus SetFocus(hWndSaveFocus) hWndSaveFocus = 0 END IF CASE %WM_COMMAND ' Process control notifications SELECT CASE AS LONG CBCTL CASE %IDC_SYSDATETIMEPICK32_7 END SELECT END SELECT END FUNCTION '------------------------------------------------------------------------------ '------------------------------------------------------------------------------ FUNCTION ShowCalendar1(BYVAL hParent AS DWORD) AS LONG LOCAL lRslt AS LONG #PBFORMS BEGIN DIALOG %IDD_dlgCalendar1->-> LOCAL hDlg AS DWORD DIALOG NEW hParent, "", 273, 137, 140, 123, %WS_CHILD OR %WS_BORDER OR _ %WS_VISIBLE OR %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT, _ %WS_EX_STATICEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _ %WS_EX_RIGHTSCROLLBAR, TO hDlg CONTROL ADD "SysMonthCal32", hDlg, %IDC_SYSMONTHCAL32_1, _ "SysMonthCal32_1", 0, 0, 140, 97, %WS_CHILD OR %WS_VISIBLE OR _ %WS_TABSTOP, %WS_EX_LEFT OR %WS_EX_LTRREADING OR _ %WS_EX_RIGHTSCROLLBAR OR %WS_EX_CLIENTEDGE CONTROL ADD BUTTON, hDlg, %Cal_Set1, "Set", 6, 102, 51, 16 CONTROL ADD BUTTON, hDlg, %btn_Clear1, "Clear", 82, 102, 49, 15 #PBFORMS END DIALOG DIALOG SHOW MODAL hDlg, CALL ShowCalendar1Proc TO lRslt #PBFORMS BEGIN CLEANUP %IDD_dlgCalendar1 #PBFORMS END CLEANUP FUNCTION = lRslt END FUNCTION
Last edited by Barry Erick; 27 Sep 2008, 09:30 PM.Barry
Comment
-
Code:CASE [COLOR="Red"]%WM_COMMAND[/COLOR] SELECT CASE AS LONG CBCTL CASE %IDC_SYSDATETIMEPICK32_7
MCM_xxxx messages are used to control the control.
There should be some MonthCal_xxxx macro/functions in COMMCTRL.INC.
Details in your SDK reference.
NHL season opens October 4-5 with games in Stockholm and Prague. North American play commences the following Thursday.
MCMMichael Mattias
Tal Systems (retired)
Port Washington WI USA
[email protected]
http://www.talsystems.com
Comment
-
> know the notify is in WM_Notify, but PBForms put all that code there.
Really.
I guess PBFORMS assumes everything sends WM_COMMAND, even "CONTROL ADD classname" controls.
I assume it put in WM_COMMAND handler code for the buttons (which do send WM_COMMAND) and you just edited it out for posting purposes.
Well, WM_COMMAND for "everything" could certainly be misleading to some people.
But let's look on the bright side: at least that code was no additional charge.
Milwaukee Admirals have a two (2) game exhibition schedule, a home-and-home with the Chicago Wolves.
The home game is at the Kern Center, which is the Milwaukee School of Engineering's ice rink... this Saturday.
MCM
BSME MSOE '72Michael Mattias
Tal Systems (retired)
Port Washington WI USA
[email protected]
http://www.talsystems.com
Comment
-
Oh GREATTTttttt....the last thing we need is MCM banging the boards
Anyone local that can cut the cable??? We need to keep him occupied with something other than HockeyEngineer's Motto: If it aint broke take it apart and fix it
"If at 1st you don't succeed... call it version 1.0"
"Half of Programming is coding"....."The other 90% is DEBUGGING"
"Document my code????" .... "WHYYY??? do you think they call it CODE? "
Comment
-
Originally posted by Michael Mattias View Post> know the notify is in WM_Notify, but PBForms put all that code there.
Really.
I guess PBFORMS assumes everything sends WM_COMMAND, even "CONTROL ADD classname" controls.
I assume it put in WM_COMMAND handler code for the buttons (which do send WM_COMMAND) and you just edited it out for posting purposes.
Well, WM_COMMAND for "everything" could certainly be misleading to some people.
But let's look on the bright side: at least that code was no additional charge.
Milwaukee Admirals have a two (2) game exhibition schedule, a home-and-home with the Chicago Wolves.
Late notice: Hi-jacked
The home game is at the Kern Center, which is the Milwaukee School of Engineering's ice rink... this Saturday.
MCM
BSME MSOE '72Last edited by Barry Erick; 24 Sep 2008, 07:42 PM. Reason: Hi-Jacked for a very good reason - GO PENS!Barry
Comment
-
Anyone local that can cut the cable??? We need to keep him occupied with something other than HockeyMichael Mattias
Tal Systems (retired)
Port Washington WI USA
[email protected]
http://www.talsystems.com
Comment
-
" I know the notify is in WM_Notify, but PBForms put all that code there."
All what code? ... your example shows a placeholder CASE for any MonthCalendar's WM_COMMAND messages (not WM_NOTIFY notifications). PB Forms does not second guess and add a WM_NOTIFY case for this and many other controls whether you are going to additionally need to intercept this or that message. In some cases there may be no specific WM_COMMAND messages, only WM_NOTIFY notification messages ... and here's the rub ... we need to be aware of that.
This is one of those cases where an NFS e-mail to [email protected] would be step 1, IMO.Rick Angell
Comment
-
In some cases there may be no specific WM_COMMAND messages, only notification messagesMichael Mattias
Tal Systems (retired)
Port Washington WI USA
[email protected]
http://www.talsystems.com
Comment
-
Um, the subject is control messages sent as part of a WM_NOTIFY message, but I'll clarify the original post.
e.g.
This notification message is sent only by month calendar controls that use the MCS_DAYSTATE style, and it is sent in the form of a WM_NOTIFY messageRick Angell
Comment
-
Quote:
Anyone local that can cut the cable??? We need to keep him occupied with something other than Hockey
To the box, sir: that cost you 2 minutes for unsportsmanlike conduct.
Reply With Quote
although VERY entertaining
boy do I have a weekend ahead of me...checking out the bruins, and razzing them, when last week I was razzing the sabres about the buins.
what a pain and fun when one can see both sides of the fence *LOL*Engineer's Motto: If it aint broke take it apart and fix it
"If at 1st you don't succeed... call it version 1.0"
"Half of Programming is coding"....."The other 90% is DEBUGGING"
"Document my code????" .... "WHYYY??? do you think they call it CODE? "
Comment
-
Were I a PBFORMS user I would suggest a new feature: "Do not generate any WM_COMMAND code for controls created with "CONTROL ADD Classname"
I don't know what it generates for the 9x compiler's new intrinsic Common Controls such as TREEVIEW, LISTVIEW, etc. Should probably generate WM_NOTIFY handling skeleton using the "new NM.CODE" and "NM.ID" (close to those) system variables.Michael Mattias
Tal Systems (retired)
Port Washington WI USA
[email protected]
http://www.talsystems.com
Comment
-
Re: "notification"
My point has nothing to do with the specific control... it was that WM_COMMAND is but one of any number of 'notification messages' .. messages sent automatically by a control or the operating system (eg WM_SYSINICHANGE).
As contasted with "command messages" ... sent by programmer to make something happen, eg, WM_SETTEXT.Michael Mattias
Tal Systems (retired)
Port Washington WI USA
[email protected]
http://www.talsystems.com
Comment
-
I don't know what it generates for the 9x compiler's new intrinsic Common Controls such as TREEVIEW, LISTVIEW, etc. Should probably generate WM_NOTIFY handling skeleton using the "new NM.CODE" and "NM.ID" (close to those) system variables.
Unused %WM_COMMAND control case statements can be removed, in my experience, and not affect interactive use of PB Forms. That said, the issue of adding %WM_COMMAND cases that would not be used has been raised by myself and others before, several ttimes, but adding another "checkmark" doe not hurt either. Expanding PB Forms to allow the addition of more generated code via option checks on the control properties tabs in PB Forms has also been NFS'dRick Angell
Comment
Comment