From: <mie...@us...> - 2012-11-07 00:58:02
|
Revision: 8565 http://sourceforge.net/p/oorexx/code-0/8565 Author: miesfeld Date: 2012-11-07 00:57:58 +0000 (Wed, 07 Nov 2012) Log Message: ----------- ooDialog - a few changes to the UserTabDemo.rex example, try to eliminate a few problems with fast switching between tabs. Modified Paths: -------------- ooDialog/trunk/examples/propertySheet.tabs/UserTabDemo.rex Modified: ooDialog/trunk/examples/propertySheet.tabs/UserTabDemo.rex =================================================================== --- ooDialog/trunk/examples/propertySheet.tabs/UserTabDemo.rex 2012-11-07 00:55:26 UTC (rev 8564) +++ ooDialog/trunk/examples/propertySheet.tabs/UserTabDemo.rex 2012-11-07 00:57:58 UTC (rev 8565) @@ -53,10 +53,12 @@ ::class 'UserTabDialog' public subclass UserDialog ::method init - expose pages + expose pages descriptions self~init:super + descriptions = self~getDescriptions + title = "Acme Health Clinic Patient Intake Form Version 1.00.0" opts = 'MINIMIZEBOX MAXIMIZEBOX' @@ -271,11 +273,11 @@ ::method activateHistory private unguarded - expose historyDlg dlgRect pages + expose historyDlg dlgRect pages descriptions reply - historyDlg = .HistoryDlg~new(dlgRect, self) + historyDlg = .HistoryDlg~new(dlgRect, self, descriptions) historyDlg~execute pages[4] = historyDlg @@ -289,25 +291,65 @@ .Alarm~new(.TimeSpan~fromMicroseconds(microseconds), .message~new(self, "onSelChange")) -::method ok +::method ok unguarded expose pages + .DlgUtil~halt + .DlgUtil~halt + /* do page over pages if page \== .nil then page~endExecution(.true) end + */ return self~ok:super +/** cancel() + * + * A problem can happen if the user hits cancel immediately after selecting the + * History tab. The initDialog() method may be still executing and a syntax + * condition can be raised if the underlying Windows dialog is ended. To + * prevent this we check for that condition and sleep a little bit if it + * happens. + */ ::method cancel unguarded expose pages do page over pages - if page \== .nil then page~endExecution(.false) + if page \== .nil then do + if page~isA(.HistoryDlg), \ page~initDialogDone then do while \ page~initDialogDone + j = SysSleep(.5) + end + page~endExecution(.false) + end end return self~cancel:super +::method getDescriptions private + d = .array~new + d[ 1] = 'Hearing loss / ringing in ears' + d[ 2] = 'Heart diease / circulatory proplems' + d[ 3] = 'Liver cancer / lung cancer' + d[ 4] = 'Breast cancer / uterine cancer' + d[ 5] = 'Jaundice, hepatitis' + d[ 6] = 'Kidney stones / kidney failure' + d[ 7] = 'High blood pressure / high chorlosterol' + d[ 8] = 'Gall bladder trouble (gallstones)' + d[ 9] = 'Anemia/blood disorder' + d[10] = 'Sugar or albumin in urine' + d[11] = 'Frequent or severe headache' + d[12] = 'Periods of unconsciousness' + d[13] = 'Chronic or frequent colds' + d[14] = 'Loss of memory or amnesia' + d[15] = 'Depression or excessive worry' + d[16] = 'Car, train, sea or air sickness' + + return d + + + ::class 'PatientDlg' subclass UserControlDialog ::method init @@ -406,9 +448,7 @@ self~createEdit( IDC_EDIT_PHYSICIAN_PHONE, 395, 178, 71, 12, AUTOSCROLLH NUMBER ) -::method initDialog unguarded - ::class 'ContactsDlg' subclass UserControlDialog ::method init @@ -490,10 +530,7 @@ -::method initDialog unguarded - - ::class 'InsuranceDlg' subclass UserControlDialog ::method init @@ -573,15 +610,18 @@ self~createEdit( IDC_EDIT_PHONE2_SI, 390, 112, 58, 12, AUTOSCROLLH NUMBER ) -::method initDialog - ::class 'HistoryDlg' subclass UserControlDialog +::attribute initDialogDone unguarded + ::method init - use arg r, parent + expose descriptions + use arg r, parent, descriptions self~init:super( , , parent) + + self~initDialogDone = .false self~create(r~left, r~top, r~right, r~bottom) ::method defineDialog @@ -594,13 +634,11 @@ self~createStaticText( IDC_STATIC , 6, 17, 229, 10, CENTER , st1Txt) self~createListView( IDC_LV_SELF , 5, 30, 229, 167, TAB ALIGNLEFT SINGLESEL REPORT ) self~createStaticText( IDC_STATIC , 241, 17, 229, 10, CENTER , st2Txt) - self~createListView( IDC_LV_FAMILY, 241, 30, 229, 167, TAB ALIGNLEFT SINGLESEL REPORT ) + self~createListView( IDC_LV_FAMILY, 241, 30, 229, 167, TAB ALIGNLEFT SINGLESEL REPORT ) ::method initDialog unguarded - expose lvSelf lvFamily + expose lvSelf lvFamily descriptions - descriptions = self~getDescriptions - lvSelf = self~newListView(IDC_LV_SELF) lvSelf~addExtendedStyle('CHECKBOXES') @@ -627,25 +665,5 @@ lvFamily~addRow( , , d) end + self~initDialogDone = .true -::method getDescriptions unguarded - - d = .array~new - d[ 1] = 'Hearing loss / ringing in ears' - d[ 2] = 'Heart diease / circulatory proplems' - d[ 3] = 'Liver cancer / lung cancer' - d[ 4] = 'Breast cancer / uterine cancer' - d[ 5] = 'Jaundice, hepatitis' - d[ 6] = 'Kidney stones / kidney failure' - d[ 7] = 'High blood pressure / high chorlosterol' - d[ 8] = 'Gall bladder trouble (gallstones)' - d[ 9] = 'Anemia/blood disorder' - d[10] = 'Sugar or albumin in urine' - d[11] = 'Frequent or severe headache' - d[12] = 'Periods of unconsciousness' - d[13] = 'Chronic or frequent colds' - d[14] = 'Loss of memory or amnesia' - d[15] = 'Depression or excessive worry' - d[16] = 'Car, train, sea or air sickness' - - return d |