Recent Posts

Pages: 1 ... 7 8 [9] 10
81
EZGUI 5 support forum / Re: Mask problem with EZ_Text
« Last post by Chris Boss on January 18, 2022, 11:04:51 am »
If you want to define the current date as the default then  set the option (in designer) to generate the %EZ_Loading event. Then in the %EZ_Loading event you can swap in a string for the current date by using the EZ_SetLoadStr command.

This way the control when first created would have the current date and then the user can change that to a different date manually.

82
EZGUI 5 support forum / Re: Mask problem with EZ_Text
« Last post by Chris Boss on January 18, 2022, 11:01:36 am »
Make sure that the data loaded into control always matches the mask (in position and length).

A Masked Edit control should never have the initial value set to a null string ("") !

The control should always have the exact number of characters in it as the mask does at all times, otherwise it messes up the control.

So rather than:

Code: [Select]
   EZ_Text %FORM1_BIRTH, 22, 12.25, 11.75, 1.75, "", "EFT{99-99-9999}"

You should have something like:

Code: [Select]
   EZ_Text %FORM1_BIRTH, 22, 12.25, 11.75, 1.75, "01-01-2000", "EFT{99-99-9999}"

There has to be a default value in the control.
83
EZGUI 5 support forum / Re: Mask problem with EZ_Text
« Last post by Brian Reynolds on January 18, 2022, 12:36:02 am »
The folling line produces exactly the same result as my earlier example.
Data looks good when loaded from a file, or off a ListView, but I can't input new daya from the keyboard

   EZ_Text %FORM1_BIRTH, 22, 12.25, 11.75, 1.75, "", "EFT{99-99-9999}"
84
EZGUI 5 support forum / Re: Mask problem with EZ_Text
« Last post by Chris Boss on January 17, 2022, 03:56:42 pm »
Change the Mask to:

{99-99-9999}

The # character may confuse the Masked Edit control since that normally is used for calculator mode masks.
85
EZGUI 5 support forum / Mask problem with EZ_Text
« Last post by Brian Reynolds on January 17, 2022, 12:51:12 am »
I am having difficulty handling a Mask with the EZ_Text control.

I have tested the following:

EZ_Text %FORM1_BIRTH, 22, 11, 14, 1.75, "", "EST{##-##-####}"
appears okay when the date "25-05-1904" is loaded from a file but doesn't allow keyboard input.

The EZ_Text line is Subclassed.

86
EZGUI 5 support forum / Re: test posts
« Last post by Chris Boss on January 11, 2022, 04:10:29 pm »
 Test program for use with new library code:

Code: [Select]
' sample application which uses ezresize.inc
'
' Portions: Copyright Christopher R. Boss, 2003 to 2006 , All Rights Reserved !
' Registered EZGUI 4.0 users may use this code Royalty Free !

'
' ======================================
' [PROTECTED CODE]         Do NOT Edit !
' ======================================
'
#COMPILE EXE
#DIM ALL        '   This is helpful to prevent errors in coding
#INCLUDE "C:\ezgui40pro\includes\ezgui40.inc"                          ' EZGUI Include file for Declares
#INCLUDE "C:\ezgui40pro\includes\ezresize.inc"
'
DECLARE FUNCTION Main_Initialize(BYVAL VerNum&) AS LONG
DECLARE SUB EZ_FORM1_Display(BYVAL Parent$)
DECLARE SUB EZ_FORM1_Design()
DECLARE SUB EZ_FORM1_ParseEvents(CID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_Events(CID&, CMsg&, CVal&, Cancel&)
'
%FORM1_BUTTON1            = 100
%FORM1_BUTTON2            = 105
%FORM1_BUTTON3            = 110
%FORM1_BUTTON4            = 115
%FORM1_LISTVIEW1          = 120
%FORM1_LISTVIEW2          = 125
%FORM1_COMBOBOX1          = 130
%FORM1_LISTBOX1           = 135
'
DECLARE SUB FORM1_BUTTON1_Events(MyID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_BUTTON2_Events(MyID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_BUTTON3_Events(MyID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_BUTTON4_Events(MyID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_LISTVIEW1_Fill(BYVAL Mode&)
DECLARE SUB FORM1_LISTVIEW1_Events(MyID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_LISTVIEW2_Fill(BYVAL Mode&)
DECLARE SUB FORM1_LISTVIEW2_Events(MyID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_COMBOBOX1_Events(MyID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_LISTBOX1_Events(MyID&, CMsg&, CVal&, Cancel&)
'
#INCLUDE "C:\ezgui40pro\includes\ezwmain.inc"                          ' EZGUI Include file for WinMain
'
SUB EZ_Main(VerNum&)     ' (PROTECTED)
     EZ_Reg %EZ_CUSTID,%EZ_REGNUM
     EZ_DefImageFolder "Graphics"
     EZ_AllowCommandEvents  0
     EZ_DefFont 6, "Arial", 10, "V"
     EZ_DefFont 7, "Courier New", 10, "F"
     EZ_DefFont 8, "Times New Roman", 10, "V"
     EZ_DefFont 9, "Modern", 10, "V"
     EZ_DefSystemColor 32, 4
     EZ_DefSystemColor 33, 5
     EZ_DefSystemColor 34, 15
     EZ_DefSystemColor 35, 24
     EZ_DefColorL 36, &HB96FFF
     EZ_DefColorL 37, &H14AB9F
     EZ_DefColorL 38, &H47A7FF
     EZ_DefColorL 39, &HD2AACF
     EZ_DefColorL 40, &H1CD5E3
     EZ_DefColorL 41, &HBC8943
     EZ_DefColorL 42, &H6C6AB7
     EZ_DefColorL 43, &HDD4489
     IF Main_Initialize(VerNum&) THEN
          EZ_FORM1_Display ""
     END IF
END SUB
'
SUB EZ_DesignWindow(FormName$)     ' (PROTECTED)
     SELECT CASE FormName$
          CASE "FORM1"
               EZ_FORM1_Design
          CASE ELSE
     END SELECT
END SUB
'
SUB EZ_Events(FormName$, CID&, CMsg&, CVal&, Cancel&)     ' (PROTECTED)
     SELECT CASE FormName$
          CASE "FORM1"
               EZ_FORM1_ParseEvents CID&, CMsg&, CVal&, Cancel&
          CASE ELSE
     END SELECT
END SUB
'
' ======================================
' [USER ACCESSABLE CODE]  You may Edit !
' ======================================
'
FUNCTION Main_Initialize(BYVAL VerNum&) AS LONG
     LOCAL RV&
     RV&=1
     FUNCTION=RV&
END FUNCTION
'
'<<BEGINFORM>> "FORM1"
'
' ======================================
' [PROTECTED CODE]         Do NOT Edit !
' ======================================
'
SUB EZ_FORM1_Display(BYVAL Parent$)     ' (PROTECTED)
     EZ_Color -1, -1
     EZ_Form "FORM1", Parent$, "Auto Resize Demo", 0, 0, 83, 29, "CZ"
END SUB
'
SUB EZ_FORM1_Design()     ' (PROTECTED)
     LOCAL CText$
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_Button %FORM1_BUTTON1, 4, 2, 16, 2, "Button  1", "T"
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_Button %FORM1_BUTTON2, 24, 2, 16, 2, "Button  2", "T"
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_Button %FORM1_BUTTON3, 43, 2, 16, 2, "Button  3", "T"
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_Button %FORM1_BUTTON4, 63, 2, 16, 2, "Button  4", "T"
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_ListView %FORM1_LISTVIEW1, 4, 14, 37, 14, "Column 1{15}|Column 2{15}{C}|Column 3{15}{R}|", "SVT"
     FORM1_LISTVIEW1_Fill -1
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_ListView %FORM1_LISTVIEW2, 41, 14, 39, 14, "Column 1{15}|Column 2{15}{C}|Column 3{15}{R}|", "SVT"
     FORM1_LISTVIEW2_Fill -1
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_ComboBox %FORM1_COMBOBOX1, 4, 12, 76, 9, "Item 1|Item 2|Item 3|Item 4|Item 5|", "SAVT"
     EZ_SelectItem "Form1", %FORM1_COMBOBOX1, 0
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_ListBox %FORM1_LISTBOX1, 4, 5, 75, 6, "Item 1|Item 2|Item 3|Item 4|Item 5|Item 6|Item 7|Item 8|Item 9|Item 10|Item 11|Item 12", "STV"
END SUB
'
SUB EZ_FORM1_ParseEvents(CID&, CMsg&, CVal&, Cancel&)     ' (PROTECTED)
     SELECT CASE CID&
          CASE %EZ_Window
               FORM1_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %FORM1_BUTTON1
               FORM1_BUTTON1_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %FORM1_BUTTON2
               FORM1_BUTTON2_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %FORM1_BUTTON3
               FORM1_BUTTON3_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %FORM1_BUTTON4
               FORM1_BUTTON4_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %FORM1_LISTVIEW1
               FORM1_LISTVIEW1_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %FORM1_LISTVIEW2
               FORM1_LISTVIEW2_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %FORM1_COMBOBOX1
               FORM1_COMBOBOX1_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %FORM1_LISTBOX1
               FORM1_LISTBOX1_Events CID&, CMsg&, CVal&, Cancel&
          CASE ELSE
               FORM1_Events CID&, CMsg&, CVal&, Cancel&
     END SELECT
END SUB
'
' ======================================
' [USER ACCESSABLE CODE]  You may Edit !
' ======================================
'
SUB FORM1_Events(CID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CID&
          CASE %EZ_Window
               SELECT CASE CMsg&
                    CASE %EZ_Loading
                    CASE %EZ_Loaded
                         LOCAL W!, H!
                         EZ_GetSize "Form1", W!, H!, 0
                         EZ_SetFormMinMax "Form1", W!, H!, 999,999
                         EZ_InitRTForm "Form1", "BUTTON", 3
                         EZ_InitRTForm "Form1", "<>BUTTON", 1
                         EZ_SetRT "Form1", %FORM1_LISTBOX1, 4
                    CASE %EZ_Started
                    CASE %EZ_Size
                         EZ_ResizeRTForm "Form1"
                    CASE %EZ_Close
                         EZ_FreeRTForm "Form1"
                    CASE ELSE
               END SELECT
          CASE ELSE
     END SELECT
END SUB
'
SUB FORM1_BUTTON1_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Click
          CASE ELSE
     END SELECT
END SUB
'
SUB FORM1_BUTTON2_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Click
          CASE ELSE
     END SELECT
END SUB
'
SUB FORM1_BUTTON3_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Click
          CASE ELSE
     END SELECT
END SUB
'
SUB FORM1_BUTTON4_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Click
          CASE ELSE
     END SELECT
END SUB
'
SUB FORM1_LISTVIEW1_Fill(BYVAL Mode&)
END SUB
'
SUB FORM1_LISTVIEW1_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Selected
          CASE ELSE
     END SELECT
END SUB
'
SUB FORM1_LISTVIEW2_Fill(BYVAL Mode&)
END SUB
'
SUB FORM1_LISTVIEW2_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Selected
          CASE ELSE
     END SELECT
END SUB
'
SUB FORM1_COMBOBOX1_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Change
          CASE ELSE
     END SELECT
END SUB
'
SUB FORM1_LISTBOX1_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Change
          CASE ELSE
     END SELECT
END SUB
'
'<<END ALL FORMS>>    UnKnown Routines follow:
#IF %EZ_NOSKIPCODE
#ENDIF 'PARSE END
'
87
EZGUI 5 support forum / Re: test posts
« Last post by Chris Boss on January 11, 2022, 04:03:54 pm »
I am getting there little by little!

I cut out of the SQL database for the old forum just the posts. I then created an app to help me convert each post one at a time.

I attached a screenshot of the app I am building.
88
EZGUI 5 support forum / Re: test posts
« Last post by Chris Boss on January 11, 2022, 04:00:03 pm »
 
Code: [Select]
' sample application which uses ezresize.inc
'
' Portions: Copyright Christopher R. Boss, 2003 to 2006 , All Rights Reserved !
' Registered EZGUI 4.0 users may use this code Royalty Free !

'
' ======================================
' [PROTECTED CODE]         Do NOT Edit !
' ======================================
'
#COMPILE EXE
#DIM ALL        '   This is helpful to prevent errors in coding
#INCLUDE "C:\\ezgui40pro\\includes\\ezgui40.inc"                          ' EZGUI Include file for Declares
#INCLUDE "C:\\ezgui40pro\\includes\\ezresize.inc"
'
DECLARE FUNCTION Main_Initialize(BYVAL VerNum&) AS LONG
DECLARE SUB EZ_FORM1_Display(BYVAL Parent$)
DECLARE SUB EZ_FORM1_Design()
DECLARE SUB EZ_FORM1_ParseEvents(CID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_Events(CID&, CMsg&, CVal&, Cancel&)
'
%FORM1_BUTTON1            = 100
%FORM1_BUTTON2            = 105
%FORM1_BUTTON3            = 110
%FORM1_BUTTON4            = 115
%FORM1_LISTVIEW1          = 120
%FORM1_LISTVIEW2          = 125
%FORM1_COMBOBOX1          = 130
%FORM1_LISTBOX1           = 135
'
DECLARE SUB FORM1_BUTTON1_Events(MyID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_BUTTON2_Events(MyID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_BUTTON3_Events(MyID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_BUTTON4_Events(MyID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_LISTVIEW1_Fill(BYVAL Mode&)
DECLARE SUB FORM1_LISTVIEW1_Events(MyID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_LISTVIEW2_Fill(BYVAL Mode&)
DECLARE SUB FORM1_LISTVIEW2_Events(MyID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_COMBOBOX1_Events(MyID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_LISTBOX1_Events(MyID&, CMsg&, CVal&, Cancel&)
'
#INCLUDE "C:\\ezgui40pro\\includes\\ezwmain.inc"                          ' EZGUI Include file for WinMain
'
SUB EZ_Main(VerNum&)     ' (PROTECTED)
     EZ_Reg %EZ_CUSTID,%EZ_REGNUM
     EZ_DefImageFolder "Graphics"
     EZ_AllowCommandEvents  0
     EZ_DefFont 6, "Arial", 10, "V"
     EZ_DefFont 7, "Courier New", 10, "F"
     EZ_DefFont 8, "Times New Roman", 10, "V"
     EZ_DefFont 9, "Modern", 10, "V"
     EZ_DefSystemColor 32, 4
     EZ_DefSystemColor 33, 5
     EZ_DefSystemColor 34, 15
     EZ_DefSystemColor 35, 24
     EZ_DefColorL 36, &HB96FFF
     EZ_DefColorL 37, &H14AB9F
     EZ_DefColorL 38, &H47A7FF
     EZ_DefColorL 39, &HD2AACF
     EZ_DefColorL 40, &H1CD5E3
     EZ_DefColorL 41, &HBC8943
     EZ_DefColorL 42, &H6C6AB7
     EZ_DefColorL 43, &HDD4489
     IF Main_Initialize(VerNum&) THEN
          EZ_FORM1_Display ""
     END IF
END SUB
'
SUB EZ_DesignWindow(FormName$)     ' (PROTECTED)
     SELECT CASE FormName$
          CASE "FORM1"
               EZ_FORM1_Design
          CASE ELSE
     END SELECT
END SUB
'
SUB EZ_Events(FormName$, CID&, CMsg&, CVal&, Cancel&)     ' (PROTECTED)
     SELECT CASE FormName$
          CASE "FORM1"
               EZ_FORM1_ParseEvents CID&, CMsg&, CVal&, Cancel&
          CASE ELSE
     END SELECT
END SUB
'
' ======================================
' [USER ACCESSABLE CODE]  You may Edit !
' ======================================
'
FUNCTION Main_Initialize(BYVAL VerNum&) AS LONG
     LOCAL RV&
     RV&=1
     FUNCTION=RV&
END FUNCTION
'
'<<BEGINFORM>> "FORM1"
'
' ======================================
' [PROTECTED CODE]         Do NOT Edit !
' ======================================
'
SUB EZ_FORM1_Display(BYVAL Parent$)     ' (PROTECTED)
     EZ_Color -1, -1
     EZ_Form "FORM1", Parent$, "Auto Resize Demo", 0, 0, 83, 29, "CZ"
END SUB
'
SUB EZ_FORM1_Design()     ' (PROTECTED)
     LOCAL CText$
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_Button %FORM1_BUTTON1, 4, 2, 16, 2, "Button  1", "T"
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_Button %FORM1_BUTTON2, 24, 2, 16, 2, "Button  2", "T"
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_Button %FORM1_BUTTON3, 43, 2, 16, 2, "Button  3", "T"
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_Button %FORM1_BUTTON4, 63, 2, 16, 2, "Button  4", "T"
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_ListView %FORM1_LISTVIEW1, 4, 14, 37, 14, "Column 1{15}|Column 2{15}{C}|Column 3{15}{R}|", "SVT"
     FORM1_LISTVIEW1_Fill -1
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_ListView %FORM1_LISTVIEW2, 41, 14, 39, 14, "Column 1{15}|Column 2{15}{C}|Column 3{15}{R}|", "SVT"
     FORM1_LISTVIEW2_Fill -1
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_ComboBox %FORM1_COMBOBOX1, 4, 12, 76, 9, "Item 1|Item 2|Item 3|Item 4|Item 5|", "SAVT"
     EZ_SelectItem "Form1", %FORM1_COMBOBOX1, 0
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_ListBox %FORM1_LISTBOX1, 4, 5, 75, 6, "Item 1|Item 2|Item 3|Item 4|Item 5|Item 6|Item 7|Item 8|Item 9|Item 10|Item 11|Item 12", "STV"
END SUB
'
SUB EZ_FORM1_ParseEvents(CID&, CMsg&, CVal&, Cancel&)     ' (PROTECTED)
     SELECT CASE CID&
          CASE %EZ_Window
               FORM1_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %FORM1_BUTTON1
               FORM1_BUTTON1_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %FORM1_BUTTON2
               FORM1_BUTTON2_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %FORM1_BUTTON3
               FORM1_BUTTON3_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %FORM1_BUTTON4
               FORM1_BUTTON4_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %FORM1_LISTVIEW1
               FORM1_LISTVIEW1_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %FORM1_LISTVIEW2
               FORM1_LISTVIEW2_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %FORM1_COMBOBOX1
               FORM1_COMBOBOX1_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %FORM1_LISTBOX1
               FORM1_LISTBOX1_Events CID&, CMsg&, CVal&, Cancel&
          CASE ELSE
               FORM1_Events CID&, CMsg&, CVal&, Cancel&
     END SELECT
END SUB
'
' ======================================
' [USER ACCESSABLE CODE]  You may Edit !
' ======================================
'
SUB FORM1_Events(CID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CID&
          CASE %EZ_Window
               SELECT CASE CMsg&
                    CASE %EZ_Loading
                    CASE %EZ_Loaded
                         EZ_InitRTForm "Form1"
                    CASE %EZ_Started
                    CASE %EZ_Size
                         EZ_ResizeRTForm "Form1"
                    CASE %EZ_Close
                         EZ_FreeRTForm "Form1"
                    CASE ELSE
               END SELECT
          CASE ELSE
     END SELECT
END SUB
'
SUB FORM1_BUTTON1_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Click
          CASE ELSE
     END SELECT
END SUB
'
SUB FORM1_BUTTON2_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Click
          CASE ELSE
     END SELECT
END SUB
'
SUB FORM1_BUTTON3_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Click
          CASE ELSE
     END SELECT
END SUB
'
SUB FORM1_BUTTON4_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Click
          CASE ELSE
     END SELECT
END SUB
'
SUB FORM1_LISTVIEW1_Fill(BYVAL Mode&)
END SUB
'
SUB FORM1_LISTVIEW1_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Selected
          CASE ELSE
     END SELECT
END SUB
'
SUB FORM1_LISTVIEW2_Fill(BYVAL Mode&)
END SUB
'
SUB FORM1_LISTVIEW2_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Selected
          CASE ELSE
     END SELECT
END SUB
'
SUB FORM1_COMBOBOX1_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Change
          CASE ELSE
     END SELECT
END SUB
'
SUB FORM1_LISTBOX1_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Change
          CASE ELSE
     END SELECT
END SUB
'
'<<END ALL FORMS>>    UnKnown Routines follow:
#IF %EZ_NOSKIPCODE
#ENDIF 'PARSE END
'

89
EZGUI 5 support forum / Re: test posts
« Last post by Chris Boss on January 11, 2022, 03:57:08 pm »
 I added a little more code here to parse out the events for the page form embeded on the printer dialog. In my example above, I didn't need to process any events for the custom controls added. If you need to process events for the controls, then you need to add a subroutine for its events.

Here is an example:

Code: [Select]
' Portions: Copyright Christopher R. Boss, 2003 to 2006 , All Rights Reserved !
' Registered EZGUI 4.0 users may use this code Royalty Free !

'
' ======================================
' [PROTECTED CODE]         Do NOT Edit !
' ======================================
'
#COMPILE EXE
#DIM ALL        '   This is helpful to prevent errors in coding
#INCLUDE &quot;C:\\ezgui40pro\\includes\\ezgui40.inc&quot;                          ' EZGUI Include file for Declares
'
DECLARE FUNCTION Main_Initialize(BYVAL VerNum&) AS LONG
DECLARE SUB OtherForm_Events(FormName$, CID&, CMsg&, CVal&, Cancel&)
DECLARE SUB OtherForm_Design(FormName$)
DECLARE SUB EZ_FORM1_Display(BYVAL Parent$)
DECLARE SUB EZ_FORM1_Design()
DECLARE SUB EZ_FORM1_ParseEvents(CID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_Events(CID&, CMsg&, CVal&, Cancel&)
'
%FORM1_BUTTON1            = 100
'
DECLARE SUB FORM1_BUTTON1_Events(MyID&, CMsg&, CVal&, Cancel&)
'
#INCLUDE &quot;C:\\ezgui40pro\\includes\\ezwmain.inc&quot;                          ' EZGUI Include file for WinMain
'
SUB EZ_Main(VerNum&)     ' (PROTECTED)
     EZ_Reg %EZ_CUSTID,%EZ_REGNUM
     EZ_DefImageFolder &quot;Graphics&quot;
     EZ_AllowCommandEvents  0
     EZ_DefFont 6, &quot;Arial&quot;, 10, &quot;V&quot;
     EZ_DefFont 7, &quot;Courier New&quot;, 10, &quot;F&quot;
     EZ_DefFont 8, &quot;Times New Roman&quot;, 10, &quot;V&quot;
     EZ_DefFont 9, &quot;Modern&quot;, 10, &quot;V&quot;
     EZ_DefSystemColor 32, 4
     EZ_DefSystemColor 33, 5
     EZ_DefSystemColor 34, 15
     EZ_DefSystemColor 35, 24
     EZ_DefColorL 36, &HB96FFF
     EZ_DefColorL 37, &H14AB9F
     EZ_DefColorL 38, &H47A7FF
     EZ_DefColorL 39, &HD2AACF
     EZ_DefColorL 40, &H1CD5E3
     EZ_DefColorL 41, &HBC8943
     EZ_DefColorL 42, &H6C6AB7
     EZ_DefColorL 43, &HDD4489
     IF Main_Initialize(VerNum&) THEN
          EZ_FORM1_Display &quot;&quot;
     END IF
END SUB
'
SUB EZ_DesignWindow(FormName$)     ' (PROTECTED)
     SELECT CASE FormName$
          CASE &quot;FORM1&quot;
               EZ_FORM1_Design
          CASE ELSE
               OtherForm_Design FormName$
     END SELECT
END SUB
'
SUB EZ_Events(FormName$, CID&, CMsg&, CVal&, Cancel&)     ' (PROTECTED)
     SELECT CASE FormName$
          CASE &quot;FORM1&quot;
               EZ_FORM1_ParseEvents CID&, CMsg&, CVal&, Cancel&
          CASE ELSE
               OtherForm_Events FormName$, CID&, CMsg&, CVal&, Cancel&
     END SELECT
END SUB
'
' ======================================
' [USER ACCESSABLE CODE]  You may Edit !
' ======================================
'
FUNCTION Main_Initialize(BYVAL VerNum&) AS LONG
     LOCAL RV&
     RV&=1
     FUNCTION=RV&
END FUNCTION
'
'<<SAVE>>
SUB PRNTPAGE_Design()
     LOCAL W!, H!, FM$
     FM$=&quot;PRNTPAGE&quot;
     EZ_GetSize FM$, W!, H!,0
     EZ_UseFont 4
     EZ_Radio 150, 1,1,20,1.25, &quot;Use Bold Face Font!&quot;, &quot;T&quot;
     EZ_Frame 100, 0,0,W!,H!,&quot;Custom Settings&quot;, &quot;&quot;
END SUB
'
SUB PRNTPAGE_Events(BYVAL CID&, BYVAL CMsg&, CVal&, Cancel&)
     ' add your control events here!
     SELECT CASE CID&
          CASE ELSE
     END SELECT
END SUB
'<<END>>
'
SUB OtherForm_Design(FormName$)
     SELECT CASE FormName$
          CASE &quot;PRNTPAGE&quot;
               PRNTPAGE_Design
          CASE ELSE
     END SELECT
END SUB
'
'<<SAVE>>
' =======================================================================
%PR_CancelID   =    2
%PR_OKID       =    1
'
SUB AddControlsToDlg()
     LOCAL W!, H!, FM$
     FM$=&quot;{PRINTDLG}&quot;
     EZ_GetSize FM$, W!, H!, 0
     EZ_ExpandForm FM$, 0, 4
     EZ_CenterForm &quot;&quot;, FM$,0
     EZ_MoveControls FM$, &quot;1,2&quot;, 0, EZ_Y(4)
     EZ_Form &quot;PRNTPAGE&quot;, FM$, &quot;&quot;, 1, H!-2.75,W!-2, 4,&quot;P&quot;
END SUB
'
GLOBAL PRNT_FontBoldFlag&
'
SUB CustomPrinterDlgEvents(BYVAL CID&, BYVAL CMsg&, CVal&, Cancel&)
     SELECT CASE CID&
          CASE %EZ_Window
               SELECT CASE CMsg&
                    CASE %EZ_Loaded
                         PRNT_FontBoldFlag&=0     ' set global flag before dialog
                         AddControlsToDlg

               END SELECT
          CASE 1    ' OK Button
               IF CMsg&=%EZ_Click THEN
                    IF EZ_GetCheck(&quot;PRNTPAGE&quot;,150) THEN PRNT_FontBoldFlag&=1
               END IF
          CASE ELSE
     END SELECT
END SUB
' =======================================================================
'<<END>>
'
SUB OtherForm_Events(FormName$, CID&, CMsg&, CVal&, Cancel&)
     SELECT CASE FormName$
          ' =======================================================================
          CASE &quot;{PRINTDLG}&quot;
               CustomPrinterDlgEvents CID&, CMsg&, CVal&, Cancel&
          CASE &quot;PRNTPAGE&quot;
               PRNTPAGE_Events CID&, CMsg&, CVal&, Cancel&
          ' =======================================================================
          CASE ELSE
     END SELECT
END SUB
'
'<<BEGINFORM>> &quot;FORM1&quot;
'
' ======================================
' [PROTECTED CODE]         Do NOT Edit !
' ======================================
'
SUB EZ_FORM1_Display(BYVAL Parent$)     ' (PROTECTED)
     EZ_Color -1, -1
     EZ_Form &quot;FORM1&quot;, Parent$, &quot;Your Dialog&quot;, 0, 0, 50, 18, &quot;C&quot;
END SUB
'
SUB EZ_FORM1_Design()     ' (PROTECTED)
     LOCAL CText$
     EZ_Color-1,-1
     EZ_UseFont 4
     EZ_Button %FORM1_BUTTON1, 4, 5, 40, 6, &quot;Display Customized Printer Dialog&quot;, &quot;T&quot;
END SUB
'
SUB EZ_FORM1_ParseEvents(CID&, CMsg&, CVal&, Cancel&)     ' (PROTECTED)
     SELECT CASE CID&
          CASE %EZ_Window
               FORM1_Events CID&, CMsg&, CVal&, Cancel&
          CASE  %FORM1_BUTTON1
               FORM1_BUTTON1_Events CID&, CMsg&, CVal&, Cancel&
          CASE ELSE
               FORM1_Events CID&, CMsg&, CVal&, Cancel&
     END SELECT
END SUB
'
' ======================================
' [USER ACCESSABLE CODE]  You may Edit !
' ======================================
'
SUB FORM1_Events(CID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CID&
          CASE %EZ_Window
               SELECT CASE CMsg&
                    CASE %EZ_Loading
                    CASE %EZ_Loaded
                    CASE %EZ_Started
                    CASE %EZ_Close
                    CASE ELSE
               END SELECT
          CASE ELSE
     END SELECT
END SUB
'
'<<SAVE>>
$MAIN   =   &quot;FORM1&quot;

SUB PrintAPage()
    LOCAL Horz&, Vert&, tWid!, tHgt!
    LOCAL EZP AS EZPRINTER
    LOCAL D$, N&, I&
    EZP.PrintWhat=1
    EZP.AllowPages=1
    EZP.AllowSelection=0
    EZP.CollateFlag=0
    EZP.FromPage=1
    EZP.ToPage=1
    EZP.MinPage=1
    EZP.MaxPage=1
    EZP.PUnits=1
    ' new stuff for custom selection of printer
'    EZP.PrnName=EZ_GetPrinter(1)
'    EZP.PrnNameSetup=2
    EZP.PrnPaperSize=1         ' letter size
    EZP.PrnOrientation=2
    EZP.PrnQuality=4
    EZP.PrnVerifyName=1
    IF EZ_ChoosePrinter($MAIN, EZP) THEN
        EZ_Color -1,-1  ' you can set the color for the Abort Dialog here
        EZ_StartDoc &quot;My Document 1&quot;  ' Auto. displays Abort Dialog
        FOR N&=1 TO 2
            IF N&=2 THEN
                EZP.PrnPaperSize=0
                EZP.PrnQuality=0
                EZP.PrnOrientation=2
                EZP.PrnPaperWidth=0
                EZP.PrnPaperLength=0
                EZP.PrnBin=0
                EZP.PrnColor=0
                EZ_SetPageAttr EZP
            END IF
            EZ_StartPage    ' EZP updated after here
            IF PRNT_FontBoldFlag& THEN
                 EZ_DefFont 51, &quot;Courier New&quot;, 48, &quot;PB&quot;       ' define a printer font
            ELSE
                 EZ_DefFont 51, &quot;Courier New&quot;, 48, &quot;P&quot;       ' define a printer font
            END IF
            Horz&=0
            Vert&=0
            EZ_Color 0, 31
            EZ_UseFont 51
            EZ_GetTextSize 51, &quot;X&quot;, tWid!, tHgt!, 2
            FOR I&=1 TO 3
                EZ_LPrint Horz&, Vert&, &quot;This is line&quot;+STR$(I&)
                Vert& = Vert& + tHgt!
            NEXT I&
            EZ_FreeFont 51
            EZ_EndPage
        NEXT N&
        EZ_EndDoc        ' Automatically Unloads the Abort Dialog
        EZ_SetForm &quot;FORM1&quot;, 1
    ELSE

    END IF
END SUB
'<<END>>

SUB FORM1_BUTTON1_Events( MyID&, CMsg&, CVal&, Cancel&)
     SELECT CASE CMsg&
          CASE %EZ_Click
               PrintAPage
          CASE ELSE
     END SELECT
END SUB
'
'<<END ALL FORMS>>    UnKnown Routines follow:
#IF %EZ_NOSKIPCODE
#ENDIF 'PARSE END
'
90
EZGUI 5 support forum / Re: test posts
« Last post by Chris Boss on January 11, 2022, 03:55:04 pm »
The key code for implimenting the autoresizing of controls, is done in the forms event code like this:

Code: [Select]
SUB FORM1_Events(CID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CID&
                    CASE %EZ_Window
                             SELECT CASE CMsg&
                                        CASE %EZ_Loading
                                        CASE %EZ_Loaded
                                                 EZ_InitRTForm &quot;Form1&quot;
                                        CASE %EZ_Started
                                        CASE %EZ_Size
                                                 EZ_ResizeRTForm &quot;Form1&quot;
                                        CASE %EZ_Close
                                                 EZ_FreeRTForm &quot;Form1&quot;
                                        CASE ELSE
                             END SELECT
                    CASE ELSE
         END SELECT
END SUB

Notice the three calls made:

EZ_InitRTForm
EZ_ResizeRTForm
EZ_FreeRTForm

There is one other routine (which I don't currently use) which is:

EZ_SetRT FormName$, ID&, RFlagVal&

This is used to change the resize table flag for how to resize the control. Currently the flag is set to 1, by default, which scales the control.

If you want to add other options to the library, simply add new flag values to the EZ_ResizeRTForm command in the select case structure. Then use EZ_SetRT to change the values manually in your code for any controls you need.

This is a start for others to build upon.

By working together on an open source library, a more advanced version can be created that all can benefit from.
Pages: 1 ... 7 8 [9] 10