From: <mie...@us...> - 2011-07-03 17:03:47
|
Revision: 7026 http://oorexx.svn.sourceforge.net/oorexx/?rev=7026&view=rev Author: miesfeld Date: 2011-07-03 17:03:40 +0000 (Sun, 03 Jul 2011) Log Message: ----------- Add dialog data program to the ooDialog samples package Modified Paths: -------------- incubator/samples/ooDialog.samples.package/install/ooDialogSamplesPackage.nsi Added Paths: ----------- incubator/samples/ooDialog.samples.package/Dialogs/dlgData/ incubator/samples/ooDialog.samples.package/Dialogs/dlgData/dlgData.h incubator/samples/ooDialog.samples.package/Dialogs/dlgData/dlgData.rc incubator/samples/ooDialog.samples.package/Dialogs/dlgData/dlgData.rex Added: incubator/samples/ooDialog.samples.package/Dialogs/dlgData/dlgData.h =================================================================== --- incubator/samples/ooDialog.samples.package/Dialogs/dlgData/dlgData.h (rev 0) +++ incubator/samples/ooDialog.samples.package/Dialogs/dlgData/dlgData.h 2011-07-03 17:03:40 UTC (rev 7026) @@ -0,0 +1,57 @@ +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2011-2011 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.oorexx.org/license.html */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/*----------------------------------------------------------------------------*/ + +#define IDD_CENSUS 100 +#define IDC_ST_1 1000 +#define IDC_ST_2 1001 +#define IDC_EDIT_FNAME 1002 +#define IDC_EDIT_LNAME 1003 +#define IDC_ST_3 1004 +#define IDC_RB_MARRIED 1005 +#define IDC_RB_SINGLE 1009 +#define IDC_RB_WIDOWED 1010 +#define IDC_RB_DIVORCED 1011 +#define IDC_RB_EMPLOYED 1016 +#define IDC_RB_RETIRED 1017 +#define IDC_RB_STUDENT 1018 +#define IDC_RB_UNEMPLOYED 1019 +#define IDC_RB_MALE 1022 +#define IDC_RB_FEMALE 1023 +#define IDC_CK_US_CITIZEN 1026 +#define IDC_CK_OVER65 1027 +#define IDC_CK_FELON 1030 +#define IDC_CK_DISABLED 1031 Added: incubator/samples/ooDialog.samples.package/Dialogs/dlgData/dlgData.rc =================================================================== --- incubator/samples/ooDialog.samples.package/Dialogs/dlgData/dlgData.rc (rev 0) +++ incubator/samples/ooDialog.samples.package/Dialogs/dlgData/dlgData.rc 2011-07-03 17:03:40 UTC (rev 7026) @@ -0,0 +1,72 @@ +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2011-2011 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.oorexx.org/license.html */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/*----------------------------------------------------------------------------*/ + +#include <windows.h> +#include <winuser.h> +#include <commctrl.h> +#include "dlgData.h" + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +IDD_CENSUS DIALOGEX 0, 0, 247, 170 +STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU +CAPTION "2010 Census Form 59-339A" +FONT 8, "Ms Shell Dlg", 400, 0, 1 +{ + LTEXT "First Name:", IDC_STATIC, 9, 24, 37, 8, WS_GROUP | SS_LEFT + EDITTEXT IDC_EDIT_FNAME, 49, 22, 66, 12, ES_AUTOHSCROLL + LTEXT "Last Name:", IDC_STATIC, 9, 44, 37, 8, SS_LEFT + EDITTEXT IDC_EDIT_LNAME, 49, 43, 66, 12, ES_AUTOHSCROLL + GROUPBOX "Marital Status", IDC_ST_1, 127, 11, 113, 53 + AUTORADIOBUTTON "Married", IDC_RB_MARRIED, 134, 25, 39, 8, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "Widowed", IDC_RB_WIDOWED, 134, 46, 39, 8 + AUTORADIOBUTTON "Single", IDC_RB_SINGLE, 193, 25, 39, 8 + AUTORADIOBUTTON "Divorced", IDC_RB_DIVORCED, 193, 46, 39, 8 + GROUPBOX "Workforce Status", IDC_ST_2, 8, 73, 121, 53 + AUTORADIOBUTTON "Employed", IDC_RB_EMPLOYED, 15, 86, 47, 8, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "Student", IDC_RB_STUDENT, 15, 107, 41, 8 + AUTORADIOBUTTON "Retired", IDC_RB_RETIRED, 72, 86, 39, 8 + AUTORADIOBUTTON "Unemployed", IDC_RB_UNEMPLOYED, 72, 107, 53, 8 + GROUPBOX "Gender", IDC_ST_3, 8, 132, 121, 31 + AUTORADIOBUTTON "Male", IDC_RB_MALE, 19, 146, 31, 8, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "Female", IDC_RB_FEMALE, 73, 145, 39, 8 + AUTOCHECKBOX "Over 65 years of age", IDC_CK_OVER65, 139, 77, 82, 8, WS_GROUP + AUTOCHECKBOX "US Citizen", IDC_CK_US_CITIZEN, 139, 95, 49, 8 + AUTOCHECKBOX "Felon", IDC_CK_FELON, 139, 113, 33, 8 + AUTOCHECKBOX "Disabled", IDC_CK_DISABLED, 139, 132, 43, 8 + DEFPUSHBUTTON "OK", IDOK, 138, 149, 50, 14, WS_GROUP + PUSHBUTTON "Cancel", IDCANCEL, 190, 149, 50, 14 +} Added: incubator/samples/ooDialog.samples.package/Dialogs/dlgData/dlgData.rex =================================================================== --- incubator/samples/ooDialog.samples.package/Dialogs/dlgData/dlgData.rex (rev 0) +++ incubator/samples/ooDialog.samples.package/Dialogs/dlgData/dlgData.rex 2011-07-03 17:03:40 UTC (rev 7026) @@ -0,0 +1,130 @@ +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2011-2011 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.oorexx.org/license.html */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/*----------------------------------------------------------------------------*/ + +/** + * This example program focuses on the use of the dialog data stem argument to + * the new() method of the various dialog classes. + * + * The dialog data stem use is interwoven with the data autodetection and data + * attributes mechanism in ooDialog. Please read the "Data Attribute Methods" + * section in the "Dialog Object" chapter from the ooDialog reference if you are + * unfamiliar with the concepts of data autodetection and data attributes. + * + * The basic idea is to set the 'data' of the dialog controls using the values + * from the dialog data stem passed as the third argument to the new() method. + * For each dialog control, set an index in the stem to the resource ID of the + * control. The 'data' of the control will be set to the value at that index. + * If there is no index in the stem for any control, the 'data' of that control + * will be set to the empty string, or 0, depending on which type of control it + * is. + * + * On return, if the user closed the dialog with 'Ok', the stem will have an + * index for every control in the dialog with a positive resource ID. The value + * for those indexes with be the 'data' of the control at the time it was + * closed. If the user cancels, the dialog data stem has no meaning. + */ + + dlgData.1005 = 1 + dlgData.1016 = 1 + dlgData.1022 = 1 + + dlg = .CensusDlg~new("dlgData.rc", IDD_CENSUS, dlgData., "dlgData.h" ) + + if dlg~execute("SHOWTOP", IDI_DLG_OOREXX) == 1 then do + l1 = 'Name:' dlgData.1003',' dlgData.1002':' || .endOfLine~copies(2) + + l2 = '09'x || 'Marital Status:' || '09'x + select + when dlgData.1005 == 1 then l2 ||= 'married' || .endOfLine + when dlgData.1009 == 1 then l2 ||= 'single' || .endOfLine + when dlgData.1010 == 1 then l2 ||= 'widowed' || .endOfLine + when dlgData.1011 == 1 then l2 ||= 'divorced' || .endOfLine + end + -- End select + + l3 = '09'x || 'Work Force Status:' || '09'x + select + when dlgData.1016 == 1 then l3 ||= 'employed' || .endOfLine + when dlgData.1017 == 1 then l3 ||= 'retired' || .endOfLine + when dlgData.1018 == 1 then l3 ||= 'student' || .endOfLine + when dlgData.1019 == 1 then l3 ||= 'unemployed' || .endOfLine + end + -- End select + + l4 = '09'x || 'Gender:' || '09'x~copies(2) + if dlgData.1022 == 1 then l4 ||= 'male' || .endOfLine~copies(2) + else l4 ||= 'female' || .endOfLine~copies(2) + + l5 = "" + if dlgData.1026 == 1 then l5 ||= 'Citizen, ' + else l5 ||= 'Non-citizen, ' + + if dlgData.1027 == 1 then l5 ||= 'elderly, ' + else l5 ||= 'youthful, ' + + if dlgData.1030 == 1 then l5 ||= 'felon, ' + else l5 ||= 'law-abiding, ' + + if dlgData.1031 == 1 then l5 ||= 'disabled, ' + else l5 ||= 'able-bodied, ' + + l5 ||= 'compliant.' -- Filled out form as required. + + msg = l1 || l2 || l3 || l4 || l5 + title = 'Form 59-339A Completed. Results:' + icon = 'INFORMATION' + end + else do + msg = 'The user canceled and did not fill out form 59-339A.' + title = 'Form 59-339A Incomplete' + icon = 'ERROR' + end + + ret = MessageDialog(msg, 0, title, 'OK', icon, 'TOPMOST') + + if icon == 'ERROR' then return 99 + +return 0 +-- End of entry point. + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*\ + Directives, Classes, or Routines. +\* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ +::requires "ooDialog.cls" + +::class 'CensusDlg' subclass RcDialog + Modified: incubator/samples/ooDialog.samples.package/install/ooDialogSamplesPackage.nsi =================================================================== --- incubator/samples/ooDialog.samples.package/install/ooDialogSamplesPackage.nsi 2011-07-03 05:19:41 UTC (rev 7025) +++ incubator/samples/ooDialog.samples.package/install/ooDialogSamplesPackage.nsi 2011-07-03 17:03:40 UTC (rev 7026) @@ -200,6 +200,11 @@ ${File} "${SRCDIR}\Controls\Edit\NumberOnly\" "restrictedInput32.dll" ${File} "${SRCDIR}\Controls\Edit\NumberOnly\" "restrictedInput64.dll" + ${SetOutPath} "$INSTDIR\Dialogs\dlgData" + ${File} "${SRCDIR}\Dialogs\dlgData\" "dlgData.h" + ${File} "${SRCDIR}\Dialogs\dlgData\" "dlgData.rc" + ${File} "${SRCDIR}\Dialogs\dlgData\" "dlgData.rex" + ; Write the uninstall keys. DetailPrint "Writing uninstall keys." WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORTNAME}" "InstallLocation" '"$INSTDIR"' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |