From: <mie...@us...> - 2013-11-16 20:03:06
|
Revision: 9514 http://sourceforge.net/p/oorexx/code-0/9514 Author: miesfeld Date: 2013-11-16 20:03:03 +0000 (Sat, 16 Nov 2013) Log Message: ----------- ooDialog - Fix up all examples in the samples\examples directory so that they can be drag and dropped on ooDialog.exe and work correctly. Modified Paths: -------------- ooDialog/branches/4.2.3/trunk/examples/examples/addManyRows.rex ooDialog/branches/4.2.3/trunk/examples/examples/genGUID.rex ooDialog/branches/4.2.3/trunk/examples/examples/imageButton.rex ooDialog/branches/4.2.3/trunk/examples/examples/openSaveFileDemo.rex ooDialog/branches/4.2.3/trunk/examples/examples/saveFileWithFilter.rex ooDialog/branches/4.2.3/trunk/examples/examples/useTools.rex ooDialog/trunk/examples/examples/addManyRows.rex ooDialog/trunk/examples/examples/genGUID.rex ooDialog/trunk/examples/examples/imageButton.rex ooDialog/trunk/examples/examples/openSaveFileDemo.rex ooDialog/trunk/examples/examples/saveFileWithFilter.rex ooDialog/trunk/examples/examples/useTools.rex Added Paths: ----------- ooDialog/branches/4.2.3/trunk/examples/examples/resources/genGUID.h ooDialog/branches/4.2.3/trunk/examples/examples/resources/genGUID.rc ooDialog/trunk/examples/examples/resources/genGUID.h ooDialog/trunk/examples/examples/resources/genGUID.rc Modified: ooDialog/branches/4.2.3/trunk/examples/examples/addManyRows.rex =================================================================== --- ooDialog/branches/4.2.3/trunk/examples/examples/addManyRows.rex 2013-11-16 18:23:06 UTC (rev 9513) +++ ooDialog/branches/4.2.3/trunk/examples/examples/addManyRows.rex 2013-11-16 20:03:03 UTC (rev 9514) @@ -85,21 +85,26 @@ * even the maximum number of items using the internal sort. */ + -- Ensure we can be run from any directory. + parse source . . srcDir + srcDir = filespec('L', srcDir) + -- Set the defaults for this application. Use the global .constDir 'O'nly, -- Read the 'addManyRows.h' file for symbolic resource ID definitions. -- And, turn automatica data detection off (.false.) - .application~setDefaults('O', 'resources\addManyRows.h', .false) + .application~setDefaults('O', srcDir'resources\addManyRows.h', .false) -- Allow the user to pick the number of items to be inserted into the -- list-view. - dlgIntro = .ExampleSetUpDlg~new('resources\addManyRows.rc', IDD_INTRO) + dlgIntro = .ExampleSetUpDlg~new(srcDir'resources\addManyRows.rc', IDD_INTRO) if dlgIntro~execute('SHOWTOP') == dlgIntro~IDCANCEL then do ret = MessageDialog('You are missing out on an excellent example', ,'User Canceled', 'OK', 'WARNING') return 99 end - dlg = .AddManyRowsDlg~new('resources\addManyRows.rc', IDD_ADD_ROWS) + dlg = .AddManyRowsDlg~new(srcDir'resources\addManyRows.rc', IDD_ADD_ROWS) if dlg~initCode = 0 then do + dlg~srcDir = srcDir dlg~itemCount = dlgIntro~selectedCount dlg~execute("SHOWTOP") end @@ -117,6 +122,7 @@ ::class 'AddManyRowsDlg' subclass RcDialog ::attribute itemCount +::attribute srcDir ::attribute createRowsTime ::attribute insertRowsTime ::attribute insertedRows @@ -212,9 +218,9 @@ * let the user decide what and how to sort. */ ::method onSortInternally unguarded - expose list staticInternal + expose list staticInternal srcDir - dlg = .SortSetupDlg~new('resources\addManyRows.rc', IDD_SORT_PARAMS) + dlg = .SortSetupDlg~new(srcDir'resources\addManyRows.rc', IDD_SORT_PARAMS) if dlg~execute('SHOWTOP') == dlg~IDCANCEL then return 0 d = .directory~new @@ -238,7 +244,7 @@ * list-view */ ::method onSortRexx unguarded - expose list staticRexxSort rexxColumn rexxAscending rexxCaseless + expose list staticRexxSort rexxColumn rexxAscending rexxCaseless srcDir count = self~itemCount @@ -263,7 +269,7 @@ if MessageDialog(msg, self~hwnd, title, 'YESNO', 'WARNING') == self~IDNO then return 0 end - dlg = .SortSetupDlg~new('resources\addManyRows.rc', IDD_SORT_PARAMS) + dlg = .SortSetupDlg~new(srcDir'resources\addManyRows.rc', IDD_SORT_PARAMS) if dlg~execute('SHOWTOP') == dlg~IDCANCEL then return 0 rexxColumn = dlg~column Modified: ooDialog/branches/4.2.3/trunk/examples/examples/genGUID.rex =================================================================== --- ooDialog/branches/4.2.3/trunk/examples/examples/genGUID.rex 2013-11-16 18:23:06 UTC (rev 9513) +++ ooDialog/branches/4.2.3/trunk/examples/examples/genGUID.rex 2013-11-16 20:03:03 UTC (rev 9514) @@ -35,10 +35,42 @@ /* */ /*----------------------------------------------------------------------------*/ -/* genGUID.rex - simple GUID generating program. */ +/** genGUID.rex - simple GUID generating program. + * + * Copy and paste the output as needed. + * + * To run in console only mode use: + * + * genGuid 1 + * + * In graphical mode you can use copy and paste of the edit control displayed. + */ + -- Ensure we can be run from any directory. + parse source . . srcDir + srcDir = filespec('L', srcDir) + + .application~setDefaults('O', srcDir'resources\genGUID.h', .false) + guid = .DlgUtil~getGUID say guid + + if arg() == 0 then do + dlg = .DisplayDlg~new(srcDir'resources\genGUID.rc', IDD_GUID_GENERATOR) + if dlg~initCode = 0 then do + dlg~guid = guid + dlg~execute("SHOWTOP") + end + end + return 0 ::requires 'ooDialog.cls' + +::class 'DisplayDlg' subclass RcDialog + +::attribute guid + +::method initDialog + expose guid + self~newEdit(IDC_EDIT_GUID)~setText(guid) Modified: ooDialog/branches/4.2.3/trunk/examples/examples/imageButton.rex =================================================================== --- ooDialog/branches/4.2.3/trunk/examples/examples/imageButton.rex 2013-11-16 18:23:06 UTC (rev 9513) +++ ooDialog/branches/4.2.3/trunk/examples/examples/imageButton.rex 2013-11-16 20:03:03 UTC (rev 9514) @@ -81,9 +81,13 @@ \* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ use arg - rcFile = "resources\imageButton.rc" - symbolFile = "resources\imageButton.h" + -- Ensure we can be run from any directory. + parse source . . srcDir + srcDir = filespec('L', srcDir) + rcFile = srcDir"resources\imageButton.rc" + symbolFile = srcDir"resources\imageButton.h" + .application~setDefaults("O", symbolFile, .false) dlg = .ImageListDlg~new(rcFile, IDD_IMAGELIST_BUTTON) @@ -94,6 +98,7 @@ return 99 end + dlg~srcDir = srcDir dlg~Execute("SHOWTOP", IDI_DLG_OOREXX) return 0 @@ -106,6 +111,8 @@ ::class 'ImageListDlg' subclass RcDialog +::attribute srcDir + ::method initDialog expose pbPush pbView pbAdd stStatus ctr imagesLoaded @@ -129,7 +136,7 @@ self~setPictureButtons ::method setPictureButtons private - expose pbView pbAdd stStatus imagesLoaded imageList + expose pbView pbAdd stStatus imagesLoaded imageList srcDir -- Using an image list with the button controls needs at least comctl32 -- version 6. See what version we are running under and don't use the image @@ -144,12 +151,12 @@ -- The images are loaded from files. files = .array~new() - files[1] = "resources\Normal.bmp" -- Normal - files[2] = "resources\Hot.bmp" -- Hot (hover) - files[3] = "resources\Pushed.bmp" -- Pushed - files[4] = "resources\Disabled.bmp" -- Disabled - files[5] = "resources\Default.bmp" -- Default button - files[6] = "resources\Hot.bmp" -- Stylus hot, tablet PC only + files[1] = srcDir"resources\Normal.bmp" -- Normal + files[2] = srcDir"resources\Hot.bmp" -- Hot (hover) + files[3] = srcDir"resources\Pushed.bmp" -- Pushed + files[4] = srcDir"resources\Disabled.bmp" -- Disabled + files[5] = srcDir"resources\Default.bmp" -- Default button + files[6] = srcDir"resources\Hot.bmp" -- Stylus hot, tablet PC only -- .ImageList~create() exposes the Windows API ImageList_Create(). Use the -- MSDN documentation to fully understand this API. Simply do a Google search Modified: ooDialog/branches/4.2.3/trunk/examples/examples/openSaveFileDemo.rex =================================================================== --- ooDialog/branches/4.2.3/trunk/examples/examples/openSaveFileDemo.rex 2013-11-16 18:23:06 UTC (rev 9513) +++ ooDialog/branches/4.2.3/trunk/examples/examples/openSaveFileDemo.rex 2013-11-16 20:03:03 UTC (rev 9514) @@ -94,10 +94,13 @@ */ if \ .application~requiredOS('Vista', 'openSaveFileDemo.rex') then return 99 + parse source . . srcDir + srcDir = filespec('L', srcDir) + -- Set up the symbolic IDs and then put up our example dialog. - .application~setDefaults('O', 'resources\osfDialogs.h', .false) + .application~setDefaults('O', srcDir'resources\osfDialogs.h', .false) - dlg = .CommonSaveDialog~new('resources\osfDialogs.rc', IDD_SIMPLE_OSF_DIALOGS) + dlg = .CommonSaveDialog~new(srcDir'resources\osfDialogs.rc', IDD_SIMPLE_OSF_DIALOGS) dlg~execute("SHOWTOP", IDI_DLG_OOREXX) return 0 Added: ooDialog/branches/4.2.3/trunk/examples/examples/resources/genGUID.h =================================================================== --- ooDialog/branches/4.2.3/trunk/examples/examples/resources/genGUID.h (rev 0) +++ ooDialog/branches/4.2.3/trunk/examples/examples/resources/genGUID.h 2013-11-16 20:03:03 UTC (rev 9514) @@ -0,0 +1,43 @@ +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2013-2013 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. */ +/* */ +/*----------------------------------------------------------------------------*/ + +#ifndef IDC_STATIC +#define IDC_STATIC (-1) +#endif + +#define IDD_GUID_GENERATOR 100 +#define IDC_EDIT_GUID 1002 Property changes on: ooDialog/branches/4.2.3/trunk/examples/examples/resources/genGUID.h ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: ooDialog/branches/4.2.3/trunk/examples/examples/resources/genGUID.rc =================================================================== --- ooDialog/branches/4.2.3/trunk/examples/examples/resources/genGUID.rc (rev 0) +++ ooDialog/branches/4.2.3/trunk/examples/examples/resources/genGUID.rc 2013-11-16 20:03:03 UTC (rev 9514) @@ -0,0 +1,51 @@ +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2013-2013 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 <commctrl.h> +#include "genGUID.h" + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +IDD_GUID_GENERATOR DIALOGEX 0, 0, 186, 64 +STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU +CAPTION "GUID Generator" +FONT 8, "Ms Shell Dlg", 400, 0, 1 +{ + CONTROL "This is your GUID:", IDC_STATIC, WC_STATIC, NOT WS_GROUP | SS_LEFT, 10, 11, 90, 10 + CONTROL "", IDC_EDIT_GUID, WC_EDIT, NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY, 11, 23, 165, 12 + CONTROL "Done", IDOK, WC_BUTTON, WS_TABSTOP | BS_DEFPUSHBUTTON, 126, 40, 50, 14 +} Property changes on: ooDialog/branches/4.2.3/trunk/examples/examples/resources/genGUID.rc ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: ooDialog/branches/4.2.3/trunk/examples/examples/saveFileWithFilter.rex =================================================================== --- ooDialog/branches/4.2.3/trunk/examples/examples/saveFileWithFilter.rex 2013-11-16 18:23:06 UTC (rev 9513) +++ ooDialog/branches/4.2.3/trunk/examples/examples/saveFileWithFilter.rex 2013-11-16 20:03:03 UTC (rev 9514) @@ -91,10 +91,13 @@ */ if \ .application~requiredOS('Vista', 'saveFileWithFilter.rex') then return 99 + parse source . . srcDir + srcDir = filespec('L', srcDir) + -- Set up the symbolic IDs and then put up our example dialog. - .application~setDefaults('O', 'resources\saveFileWithFilter.h', .false) + .application~setDefaults('O', srcDir'resources\saveFileWithFilter.h', .false) - dlg = .CommonSaveDialog~new('resources\saveFileWithFilter.rc', IDD_SAVE_FILE) + dlg = .CommonSaveDialog~new(srcDir'resources\saveFileWithFilter.rc', IDD_SAVE_FILE) dlg~execute("SHOWTOP", IDI_DLG_OOREXX) return 0 Modified: ooDialog/branches/4.2.3/trunk/examples/examples/useTools.rex =================================================================== --- ooDialog/branches/4.2.3/trunk/examples/examples/useTools.rex 2013-11-16 18:23:06 UTC (rev 9513) +++ ooDialog/branches/4.2.3/trunk/examples/examples/useTools.rex 2013-11-16 20:03:03 UTC (rev 9514) @@ -61,11 +61,14 @@ * underlying Windows dialog. */ - .application~useGlobalConstDir("O", "resources\useTools.h") + parse source . . srcDir + srcDir = filespec('L', srcDir) + .application~useGlobalConstDir("O", srcDir"resources\useTools.h") + dlg = .MainDialog~new - dlgTool = .ToolPaletteDlg~new + dlgTool = .ToolPaletteDlg~new(srcDir) dlgTool~ownerDialog = dlg -- Start the main dialog asynchronously so we continue and then can start the @@ -206,10 +209,11 @@ ::method init expose s buttonIDs - forward class (super) continue + self~init:super + --forward class (super) continue -- Populate the buttonIDs and buttonNames arrays. - self~populateButtons + self~populateButtons(arg(1)) -- The bitmaps are 32 x 32, we want the button to have a 4 pixel margin so -- that the button high-lighting for hot, pressed, default, etc., shows. @@ -325,6 +329,7 @@ -- names. ::method populateButtons private expose buttonIDs buttonNames + use strict arg srcDir buttonIDs = .array~of(IDC_PB_LOCKMODULE, - IDC_PB_LOCKPROJECT, - @@ -340,17 +345,17 @@ IDC_PB_CLOSE - ) - buttonNames = .array~of('resources\LockModule.bmp', - - 'resources\LockProject.bmp', - - 'resources\SplitModule.bmp', - - 'resources\SaveModule.bmp', - - 'resources\SaveProject.bmp', - - 'resources\SaveAll.bmp', - - 'resources\CheckIn.bmp', - - 'resources\LinkToWeb.bmp', - - 'resources\CodeReview.bmp', - - 'resources\Update.bmp', - - 'resources\ProjectReview.bmp', - - 'resources\ClosePalette.bmp' - + buttonNames = .array~of(srcDir'resources\LockModule.bmp', - + srcDir'resources\LockProject.bmp', - + srcDir'resources\SplitModule.bmp', - + srcDir'resources\SaveModule.bmp', - + srcDir'resources\SaveProject.bmp', - + srcDir'resources\SaveAll.bmp', - + srcDir'resources\CheckIn.bmp', - + srcDir'resources\LinkToWeb.bmp', - + srcDir'resources\CodeReview.bmp', - + srcDir'resources\Update.bmp', - + srcDir'resources\ProjectReview.bmp', - + srcDir'resources\ClosePalette.bmp' - ) Modified: ooDialog/trunk/examples/examples/addManyRows.rex =================================================================== --- ooDialog/trunk/examples/examples/addManyRows.rex 2013-11-16 18:23:06 UTC (rev 9513) +++ ooDialog/trunk/examples/examples/addManyRows.rex 2013-11-16 20:03:03 UTC (rev 9514) @@ -85,21 +85,26 @@ * even the maximum number of items using the internal sort. */ + -- Ensure we can be run from any directory. + parse source . . srcDir + srcDir = filespec('L', srcDir) + -- Set the defaults for this application. Use the global .constDir 'O'nly, -- Read the 'addManyRows.h' file for symbolic resource ID definitions. -- And, turn automatica data detection off (.false.) - .application~setDefaults('O', 'resources\addManyRows.h', .false) + .application~setDefaults('O', srcDir'resources\addManyRows.h', .false) -- Allow the user to pick the number of items to be inserted into the -- list-view. - dlgIntro = .ExampleSetUpDlg~new('resources\addManyRows.rc', IDD_INTRO) + dlgIntro = .ExampleSetUpDlg~new(srcDir'resources\addManyRows.rc', IDD_INTRO) if dlgIntro~execute('SHOWTOP') == dlgIntro~IDCANCEL then do ret = MessageDialog('You are missing out on an excellent example', ,'User Canceled', 'OK', 'WARNING') return 99 end - dlg = .AddManyRowsDlg~new('resources\addManyRows.rc', IDD_ADD_ROWS) + dlg = .AddManyRowsDlg~new(srcDir'resources\addManyRows.rc', IDD_ADD_ROWS) if dlg~initCode = 0 then do + dlg~srcDir = srcDir dlg~itemCount = dlgIntro~selectedCount dlg~execute("SHOWTOP") end @@ -117,6 +122,7 @@ ::class 'AddManyRowsDlg' subclass RcDialog ::attribute itemCount +::attribute srcDir ::attribute createRowsTime ::attribute insertRowsTime ::attribute insertedRows @@ -212,9 +218,9 @@ * let the user decide what and how to sort. */ ::method onSortInternally unguarded - expose list staticInternal + expose list staticInternal srcDir - dlg = .SortSetupDlg~new('resources\addManyRows.rc', IDD_SORT_PARAMS) + dlg = .SortSetupDlg~new(srcDir'resources\addManyRows.rc', IDD_SORT_PARAMS) if dlg~execute('SHOWTOP') == dlg~IDCANCEL then return 0 d = .directory~new @@ -238,7 +244,7 @@ * list-view */ ::method onSortRexx unguarded - expose list staticRexxSort rexxColumn rexxAscending rexxCaseless + expose list staticRexxSort rexxColumn rexxAscending rexxCaseless srcDir count = self~itemCount @@ -263,7 +269,7 @@ if MessageDialog(msg, self~hwnd, title, 'YESNO', 'WARNING') == self~IDNO then return 0 end - dlg = .SortSetupDlg~new('resources\addManyRows.rc', IDD_SORT_PARAMS) + dlg = .SortSetupDlg~new(srcDir'resources\addManyRows.rc', IDD_SORT_PARAMS) if dlg~execute('SHOWTOP') == dlg~IDCANCEL then return 0 rexxColumn = dlg~column Modified: ooDialog/trunk/examples/examples/genGUID.rex =================================================================== --- ooDialog/trunk/examples/examples/genGUID.rex 2013-11-16 18:23:06 UTC (rev 9513) +++ ooDialog/trunk/examples/examples/genGUID.rex 2013-11-16 20:03:03 UTC (rev 9514) @@ -35,10 +35,42 @@ /* */ /*----------------------------------------------------------------------------*/ -/* genGUID.rex - simple GUID generating program. */ +/** genGUID.rex - simple GUID generating program. + * + * Copy and paste the output as needed. + * + * To run in console only mode use: + * + * genGuid 1 + * + * In graphical mode you can use copy and paste of the edit control displayed. + */ + -- Ensure we can be run from any directory. + parse source . . srcDir + srcDir = filespec('L', srcDir) + + .application~setDefaults('O', srcDir'resources\genGUID.h', .false) + guid = .DlgUtil~getGUID say guid + + if arg() == 0 then do + dlg = .DisplayDlg~new(srcDir'resources\genGUID.rc', IDD_GUID_GENERATOR) + if dlg~initCode = 0 then do + dlg~guid = guid + dlg~execute("SHOWTOP") + end + end + return 0 ::requires 'ooDialog.cls' + +::class 'DisplayDlg' subclass RcDialog + +::attribute guid + +::method initDialog + expose guid + self~newEdit(IDC_EDIT_GUID)~setText(guid) Modified: ooDialog/trunk/examples/examples/imageButton.rex =================================================================== --- ooDialog/trunk/examples/examples/imageButton.rex 2013-11-16 18:23:06 UTC (rev 9513) +++ ooDialog/trunk/examples/examples/imageButton.rex 2013-11-16 20:03:03 UTC (rev 9514) @@ -81,9 +81,13 @@ \* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ use arg - rcFile = "resources\imageButton.rc" - symbolFile = "resources\imageButton.h" + -- Ensure we can be run from any directory. + parse source . . srcDir + srcDir = filespec('L', srcDir) + rcFile = srcDir"resources\imageButton.rc" + symbolFile = srcDir"resources\imageButton.h" + .application~setDefaults("O", symbolFile, .false) dlg = .ImageListDlg~new(rcFile, IDD_IMAGELIST_BUTTON) @@ -94,6 +98,7 @@ return 99 end + dlg~srcDir = srcDir dlg~Execute("SHOWTOP", IDI_DLG_OOREXX) return 0 @@ -106,6 +111,8 @@ ::class 'ImageListDlg' subclass RcDialog +::attribute srcDir + ::method initDialog expose pbPush pbView pbAdd stStatus ctr imagesLoaded @@ -129,7 +136,7 @@ self~setPictureButtons ::method setPictureButtons private - expose pbView pbAdd stStatus imagesLoaded imageList + expose pbView pbAdd stStatus imagesLoaded imageList srcDir -- Using an image list with the button controls needs at least comctl32 -- version 6. See what version we are running under and don't use the image @@ -144,12 +151,12 @@ -- The images are loaded from files. files = .array~new() - files[1] = "resources\Normal.bmp" -- Normal - files[2] = "resources\Hot.bmp" -- Hot (hover) - files[3] = "resources\Pushed.bmp" -- Pushed - files[4] = "resources\Disabled.bmp" -- Disabled - files[5] = "resources\Default.bmp" -- Default button - files[6] = "resources\Hot.bmp" -- Stylus hot, tablet PC only + files[1] = srcDir"resources\Normal.bmp" -- Normal + files[2] = srcDir"resources\Hot.bmp" -- Hot (hover) + files[3] = srcDir"resources\Pushed.bmp" -- Pushed + files[4] = srcDir"resources\Disabled.bmp" -- Disabled + files[5] = srcDir"resources\Default.bmp" -- Default button + files[6] = srcDir"resources\Hot.bmp" -- Stylus hot, tablet PC only -- .ImageList~create() exposes the Windows API ImageList_Create(). Use the -- MSDN documentation to fully understand this API. Simply do a Google search Modified: ooDialog/trunk/examples/examples/openSaveFileDemo.rex =================================================================== --- ooDialog/trunk/examples/examples/openSaveFileDemo.rex 2013-11-16 18:23:06 UTC (rev 9513) +++ ooDialog/trunk/examples/examples/openSaveFileDemo.rex 2013-11-16 20:03:03 UTC (rev 9514) @@ -94,10 +94,13 @@ */ if \ .application~requiredOS('Vista', 'openSaveFileDemo.rex') then return 99 + parse source . . srcDir + srcDir = filespec('L', srcDir) + -- Set up the symbolic IDs and then put up our example dialog. - .application~setDefaults('O', 'resources\osfDialogs.h', .false) + .application~setDefaults('O', srcDir'resources\osfDialogs.h', .false) - dlg = .CommonSaveDialog~new('resources\osfDialogs.rc', IDD_SIMPLE_OSF_DIALOGS) + dlg = .CommonSaveDialog~new(srcDir'resources\osfDialogs.rc', IDD_SIMPLE_OSF_DIALOGS) dlg~execute("SHOWTOP", IDI_DLG_OOREXX) return 0 Added: ooDialog/trunk/examples/examples/resources/genGUID.h =================================================================== --- ooDialog/trunk/examples/examples/resources/genGUID.h (rev 0) +++ ooDialog/trunk/examples/examples/resources/genGUID.h 2013-11-16 20:03:03 UTC (rev 9514) @@ -0,0 +1,43 @@ +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2013-2013 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. */ +/* */ +/*----------------------------------------------------------------------------*/ + +#ifndef IDC_STATIC +#define IDC_STATIC (-1) +#endif + +#define IDD_GUID_GENERATOR 100 +#define IDC_EDIT_GUID 1002 Property changes on: ooDialog/trunk/examples/examples/resources/genGUID.h ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: ooDialog/trunk/examples/examples/resources/genGUID.rc =================================================================== --- ooDialog/trunk/examples/examples/resources/genGUID.rc (rev 0) +++ ooDialog/trunk/examples/examples/resources/genGUID.rc 2013-11-16 20:03:03 UTC (rev 9514) @@ -0,0 +1,51 @@ +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2013-2013 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 <commctrl.h> +#include "genGUID.h" + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +IDD_GUID_GENERATOR DIALOGEX 0, 0, 186, 64 +STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU +CAPTION "GUID Generator" +FONT 8, "Ms Shell Dlg", 400, 0, 1 +{ + CONTROL "This is your GUID:", IDC_STATIC, WC_STATIC, NOT WS_GROUP | SS_LEFT, 10, 11, 90, 10 + CONTROL "", IDC_EDIT_GUID, WC_EDIT, NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY, 11, 23, 165, 12 + CONTROL "Done", IDOK, WC_BUTTON, WS_TABSTOP | BS_DEFPUSHBUTTON, 126, 40, 50, 14 +} Property changes on: ooDialog/trunk/examples/examples/resources/genGUID.rc ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: ooDialog/trunk/examples/examples/saveFileWithFilter.rex =================================================================== --- ooDialog/trunk/examples/examples/saveFileWithFilter.rex 2013-11-16 18:23:06 UTC (rev 9513) +++ ooDialog/trunk/examples/examples/saveFileWithFilter.rex 2013-11-16 20:03:03 UTC (rev 9514) @@ -91,10 +91,13 @@ */ if \ .application~requiredOS('Vista', 'saveFileWithFilter.rex') then return 99 + parse source . . srcDir + srcDir = filespec('L', srcDir) + -- Set up the symbolic IDs and then put up our example dialog. - .application~setDefaults('O', 'resources\saveFileWithFilter.h', .false) + .application~setDefaults('O', srcDir'resources\saveFileWithFilter.h', .false) - dlg = .CommonSaveDialog~new('resources\saveFileWithFilter.rc', IDD_SAVE_FILE) + dlg = .CommonSaveDialog~new(srcDir'resources\saveFileWithFilter.rc', IDD_SAVE_FILE) dlg~execute("SHOWTOP", IDI_DLG_OOREXX) return 0 Modified: ooDialog/trunk/examples/examples/useTools.rex =================================================================== --- ooDialog/trunk/examples/examples/useTools.rex 2013-11-16 18:23:06 UTC (rev 9513) +++ ooDialog/trunk/examples/examples/useTools.rex 2013-11-16 20:03:03 UTC (rev 9514) @@ -61,11 +61,14 @@ * underlying Windows dialog. */ - .application~useGlobalConstDir("O", "resources\useTools.h") + parse source . . srcDir + srcDir = filespec('L', srcDir) + .application~useGlobalConstDir("O", srcDir"resources\useTools.h") + dlg = .MainDialog~new - dlgTool = .ToolPaletteDlg~new + dlgTool = .ToolPaletteDlg~new(srcDir) dlgTool~ownerDialog = dlg -- Start the main dialog asynchronously so we continue and then can start the @@ -206,10 +209,11 @@ ::method init expose s buttonIDs - forward class (super) continue + self~init:super + --forward class (super) continue -- Populate the buttonIDs and buttonNames arrays. - self~populateButtons + self~populateButtons(arg(1)) -- The bitmaps are 32 x 32, we want the button to have a 4 pixel margin so -- that the button high-lighting for hot, pressed, default, etc., shows. @@ -325,6 +329,7 @@ -- names. ::method populateButtons private expose buttonIDs buttonNames + use strict arg srcDir buttonIDs = .array~of(IDC_PB_LOCKMODULE, - IDC_PB_LOCKPROJECT, - @@ -340,17 +345,17 @@ IDC_PB_CLOSE - ) - buttonNames = .array~of('resources\LockModule.bmp', - - 'resources\LockProject.bmp', - - 'resources\SplitModule.bmp', - - 'resources\SaveModule.bmp', - - 'resources\SaveProject.bmp', - - 'resources\SaveAll.bmp', - - 'resources\CheckIn.bmp', - - 'resources\LinkToWeb.bmp', - - 'resources\CodeReview.bmp', - - 'resources\Update.bmp', - - 'resources\ProjectReview.bmp', - - 'resources\ClosePalette.bmp' - + buttonNames = .array~of(srcDir'resources\LockModule.bmp', - + srcDir'resources\LockProject.bmp', - + srcDir'resources\SplitModule.bmp', - + srcDir'resources\SaveModule.bmp', - + srcDir'resources\SaveProject.bmp', - + srcDir'resources\SaveAll.bmp', - + srcDir'resources\CheckIn.bmp', - + srcDir'resources\LinkToWeb.bmp', - + srcDir'resources\CodeReview.bmp', - + srcDir'resources\Update.bmp', - + srcDir'resources\ProjectReview.bmp', - + srcDir'resources\ClosePalette.bmp' - ) |