Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Chris Boss

Pages: 1 2 [3] 4
31
EZGUI 5 support forum / Re: Mask problem with EZ_Text
« 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.

32
EZGUI 5 support forum / Re: Mask problem with EZ_Text
« 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.

33
EZGUI 5 support forum / Re: test posts
« 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
'

34
EZGUI 5 support forum / Re: test posts
« 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.

35
EZGUI 5 support forum / Re: test posts
« 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
'


36
EZGUI 5 support forum / Re: test posts
« 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
'

37
EZGUI 5 support forum / Re: test posts
« 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.

38
EZGUI 5 support forum / Re: test posts
« on: January 11, 2022, 03:45:04 pm »
Here is an include file which has a library of routines that makes working with tooltips easy.

ezttip.inc

Code: [Select]
&' Note: You define the following function in your main apps code:
DECLARE FUNCTION DefineToolTipText(BYVAL hDlg&amp;, BYVAL IDNum&amp;) AS STRING

&' *************************************************************
&' EZGUI Freeware ToolTip Library !!!
&' -------------------------------------------------------------
&' Copyright 2005, Christopher R. Boss, All Rights Reserved !
&' This source code is offered as freeware. You may use it
&' Royalty free, but you must maintain this copyright notice
&' with the code. No warranty made !
&' Provided by Computer Workshop.
&' http://ezgui.com , also http://cwsof.com
&' *************************************************************
GLOBAL g_ToolTipText AS ASCIIZ*1024
&'
FUNCTION CreateDlgToolTip(BYVAL hDlg&amp;, BYVAL MaxWidth&amp;, BYVAL TextColor&amp;, BYVAL BGColor&amp;) AS LONG
  LOCAL WS&amp;, EWS&amp;, CName AS ASCIIZ*32, hCtrl&amp;
  WS&amp;=%WS_POPUP OR %TTS_ALWAYSTIP OR %TTS_BALLOON
  EWS&amp;=%WS_EX_TOOLWINDOW
  CName=$TOOLTIPS_CLASS
  hCtrl&amp;=CreateWindowEx(EWS&amp;, CName,&quot;&quot;, WS&amp;,0,0,32,32,hDlg&amp;,0,GetModuleHandle(BYVAL %NULL), BYVAL %NULL)
  SendMessage hCtrl&amp;, %TTM_SETMAXTIPWIDTH, 0, MaxWidth&amp;
  SendMessage hCtrl&amp;, %TTM_SETTIPTEXTCOLOR,TextColor&amp;,0
  SendMessage hCtrl&amp;, %TTM_SETTIPBKCOLOR, BGColor&amp;,0
  FUNCTION=hCtrl&amp;
END FUNCTION
&'
SUB AddTool(BYVAL hToolTip&amp;, BYVAL hDlg&amp;, BYVAL IDNum&amp;)
  LOCAL TT AS TOOLINFO, hCtrl&amp;, RV&amp;
  CONTROL HANDLE hDlg&amp;, IDNum&amp; TO hCtrl&amp;
  IF hCtrl&amp;&lt;&gt;0 THEN
  TT.cbSize=SIZEOF(TT)
  TT.uFlags=%TTF_IDISHWND OR %TTF_SUBCLASS
  TT.hwnd=hDlg&amp;
  TT.uId=hCtrl&amp;
  &' TT.rec=
  TT.hinst=GetModuleHandle(BYVAL %NULL)
  TT.lpszText=%LPSTR_TEXTCALLBACK
  TT.lParam=0
  RV&amp;=SendMessage(hToolTip&amp;, %TTM_ADDTOOL,0, VARPTR(TT))
  END IF
END SUB
&'
FUNCTION GetClassType(BYVAL hCtrl&amp;) AS STRING
  LOCAL zC AS ASCIIZ*33, X&amp;
  X&amp;=GetClassName(hCtrl&amp;, zC,32)
  FUNCTION=zC
END FUNCTION
&'
FUNCTION MKCRLF(BYVAL T$) AS STRING
  REPLACE &quot;|&quot; WITH CHR$(13)+CHR$(10) IN T$
  FUNCTION=T$
END FUNCTION
&'
FUNCTION TestForToolTip(BYVAL hDlg&amp;, BYVAL Msg&amp;, BYVAL wParam&amp;, BYVAL lParam&amp;) AS LONG
  LOCAL RV&amp;, pNM AS NMHDR PTR, pTT AS NMTTDISPINFO PTR
  LOCAL hCtrl&amp;, hTipTool&amp;, IDNum&amp;
  RV&amp;=0
  IF Msg&amp;=%WM_NOTIFY THEN
  pNM=lParam&amp;
  hCtrl&amp;=@pNM.hwndFrom
  hTipTool&amp;=@pNM.idfrom
  IF GetClassType(hCtrl&amp;)=$TOOLTIPS_CLASS THEN
  IF @pNM.code=%TTN_NEEDTEXT THEN
  pTT=lParam&amp;
  IDNum&amp;=GetDlgCtrlID(hTipTool&amp;)
  &' this method is limited to 80 characters
  &' @pTT.szText=left$(DefineToolTipText(hDlg&amp;, IDNum&amp;),79)
  &' this method is limited to size of my global variable !
  g_ToolTipText=MKCRLF(DefineToolTipText(hDlg&amp;, IDNum&amp;))
  @pTT.lpszText=VARPTR(g_ToolTipText)
  RV&amp;=1
  END IF
  END IF
  END IF
END FUNCTION

&' *************************************************************
&' End ToolTip Library
&' *************************************************************
&'

39
EZGUI 5 support forum / test posts
« on: January 11, 2022, 03:44:55 pm »
This is for testing my repost efforts of previous forum.

This is just for testing the format of the text I convert.

40
Advanced EZGUI / About this forum
« on: January 11, 2022, 12:57:27 pm »
This forum is for posting source code, explanations and having discussions about more advanced tasks using EZGUI 5.0 Professional.

It is my experience that most EZGUI users have not even barely tapped into the more advanced features found in EZGUI.

The purpose of this sub-forum is to help EZGUI users push EZGUI 5 to its limits.

I am currently doing custom app development for clients using PB10/EZGUI 5 and I myself am learning how to push EZGUI to its limits.

41
General Discussion / Registration on new forums
« on: January 10, 2022, 12:02:38 pm »
Sadly I lost much of the data from my old forums because of problems trying to upgrade the old forum. Had to resort to a clean install of the latest version of the forum software, but have not been able to import in all the old data (I may be able to get some of the data reposted in future for for now can't).

This means if you were registered on the old forums you need to request registration all over again for the new forums.

Just send me an email and ask to be registered on the new forums to:

chrisboss@centurylink.net

or

support@cwsof.com

The first email address above gets to me quicker.

I need your User Name (real names required) and email address for the account.

42
EZGUI 5 support forum / So where does EZGUI go from here ?
« on: December 02, 2021, 04:41:34 pm »
Will there be an EZGUI 6.0 ?

Maybe.

So what have I been doing since the release of EZGUI 5.0 Pro and does EZGUI have a future ?

EZGUI definitely has a future as long as 32 bit Windows app are supported by Windows.

I have tested a few EZGUI apps on Windows 11 and just as expected it works very well. So EZGUI should have a good future for at least as long as Windows 11 exists and Windows 64 bit can still run 32 bit apps.

Why no new version of EZGUI yet ?

One thing is that EZGUI 5.0 is so feature rich there is not a lot missing in it. IMO most EZGUI users have not tapped into the raw power found in the EZGUI engine. But I have !

For the last 2 years I have been working on custom programming applications for clients, using EZGUI 5.0 Pro (and Powerbasic 10).  I am finding so many ways to push EZGUI far beyond what most users likely are doing. For one I have really pushed the limit of using Ownerdraw and more and more I am finding ways to solve all sorts of problems.

How about writing an application that can change the user interface into different languages ?

(See the picture attached to this post.)

Using Ownerdraw and a few extra WIN32 API calls I have been able to create an app which can switch between multiple languages. I used PB Forms and wrote a simple "Language" editor to define templates for different languages and then in the actual app I used ownerdraw controls and could switch between languages dynamically. Now of couse EZGUI does not support Unicode yet, but for non-Unicode languages you could use existing EZGUI controls. The app I wrote only needed other languages for buttons and labels, so I could support unicode using the WIN32 API and ownerdraw.

Ownerdraw is extremely powerful and probably under used in Windows apps.  The point is that by tapping into the more low level engines in EZGUI you can do some amazing things. How about 3D buttons (ownerdraw) with transparent images on them. All sorts of things are possible.

One of the things I need to do here on the forums is to start teaching EZGUI users how to tap into many of these low level engines in EZGUI.

So look for upcoming updates on these forums with ideas of how to push EZGUI 5.0 to the limit.


43
EZGUI 5 support forum / Good News about EZGUI 5.0 on Windows 11
« on: November 06, 2021, 01:01:43 pm »
Just updated one of my PC's to Windows 11.

EZGUI is looking good so far, running on Windows 11.

Always worried about a new version of Windows breaking ones apps, but so far it appears that EZGUI runs fine on Windows 11.

Not an extensive test by any means, but tested a number of features in EZGUI such as Sprites, OpenGL 3D, Visual Designer, window regions, ownerdraw and more.

44
In this post I will mention a number of common questions new users may have before purchasing EZGUI 5.0 Professional:

(1) What compilers does EZGUI work with ?

EZGUI was designed for use with the Powerbasic Windows compilers. It should work with nearly any of their Windows compilers such as PB 6.x, 7.x, 8.x, 9.x and 10.x

While not designed for them, it is possible to use EZGUI with the Powerbasic Console compilers as well, but it will require a little "tweaking" to do so. If the Console compiler supports a command to turn off the default console window, you will have to manually add that command to your apps code each time you compile it. I can also provide an old utility app (which came with EZGUI 4.0) you can use which can modify the compiled EXE after compiling (needs to change a single byte in EXE header).

It is recommended though to use the Powerbasic Windows compilers.

(2) Will EZGUI work with any other programming languages ?

In theory if could, but the biggest problem is that most programming languages use a C like string type for variable length strings.

Powerbasic uses the WIN32 OLE API's for variable length strings which is what the EZGUI run time API's expect.

The EZGUI runtime is a standard DLL (32 bit) so it can be accessed by any programming language, but because of the OLE string issue most languages may be able to work properly with it.

Also the include files for EZGUI are for Powerbasic compilers only and would have to be converted for another language.

(3) Will EZGUI 5.0 work on Windows 10 ?

YES.  EZGUI was designed using core WIN32 API's which make it extremely compatible with most versions of Windows, including new ones.

Because of this it can run on Windows 98, ME, Vista, XP, 7, 8 and 10 !

EZGUI knows what version of Windows it is running on and adjusts to it. Some features are simply turned off on Windows 98, ME and Vista. About 95% of the feature set works on those older versions. From Windows XP and on , all of EZGUI's features are active.

The OpenGL Canvas control in EZGUI requires that the core OpenGL drivers are installed for that to work. Most PC's support OpenGL so that should not be a problem.

(4) How large is the EZGUI runtime ?

The primary runtime DLL is only about 700 KB in size. There are a few other secondary runtime DLLs (ie. OpenGL Canvas control) and when using them the entire runtime is about 1 megabyte in size. The entire runtime can fit on an old fashioned floppy disk.

(5) Does EZGUI have a Form Editor ?

Yes, EZGUI 5.0 has its own Visual Designer (Form Editor). It does not though have a code editor built in. Instead it uses what I call a "Smart Parser" technology which let's you use the Designer with any compatible external code editor when generating code. The Smart Parser literally rewrites your source code when forms have been modified, each time you generate code. This allows a seamless integration between the Designer and your favorite code editor.

To be compatible the code editor needs to be compatible with the Powerbasic compiler and also support the passing of a filename to the command line. That is all.

(6) How much does EZGUI 5.0 Professional cost ?

Currently as of  9/24/2021 the price is only $39 and I don't expect it to change anytime soon.

EZGUI 5.0 originally sold for $249 when it was released and even at that price was worth every penny.

At the current $39 it is a real deal.

(7) Do I still get the same quality tech support if I buy EZGUI at your highly discounted price ?

Absolutely ! I provide the same tech support to all EZGUI users.




45
EZGUI 5 support forum / Re: Unselect in Listview
« on: September 21, 2021, 08:39:16 pm »
You can change a listview items "state" by using the EZ_SetLVItem command using just the "{S}" (state) property.  You pass an additional S for Selected (otherwise unselected) and F for Focus (otherwise no focus. The property string would be:

"{S}"

to turn off both selected and focus state

"{S}SF"

to turn ON both selected and focus state

Pages: 1 2 [3] 4