Announcement

Collapse
No announcement yet.

EZGUI 4.0 Pro sale almost over - save $150

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • EZGUI 4.0 Pro sale almost over - save $150

    EZGUI 4.0 Professional is still on sale for only $99 until April 30, 2009.

    This is a great deal, so don't let it go by.

    If you are stuck using DOS or writing console apps and you need to make the move to real GUI apps, give EZGUI a try.

    EZGUI's design makes the move from DOS/Console programming to Windows GUI programming as painless as is possible. You don't have to be overwhelmed with the Windows API (EZGUI apps don't even normally require the API include files). EZGUI gives you a rich command set, which is very Basic like in nature. The commands are simple in syntax and easy to learn.

    The Event engine in EZGUI makes learning events easier for DOS programmers.
    Chris Boss
    Computer Workshop
    Developer of "EZGUI"
    http://cwsof.com
    http://twitter.com/EZGUIProGuy

  • #2
    The real test. source code

    For you DOS/Console programmers ready to make the move to Windows GUI programming, the real test is source code.

    Let's look a sample project that comes with EZGUI 4.0 Pro.

    This is not simple hello world program. This is a complex RichEdit Editor, which allows you to read,edit and save RTF files. The editor uses fancy 3D buttons, a Rebar, Toolbar, Ownerdraw Comboboxes (displays fonts and colors) and it can even do a print preview and also print RTF text to a printer.

    Now imagine the complex API code necessary to write a program like this.

    Well, let's see how the EZGUI applications source code looks.

    If you are currently a DOS/Console programmer and you can make sense of this source code (understand what it is doing) then I see no reason why you can't make the jump from DOS/Console coding to coding with EZGUI to produce real Windows GUI apps.

    Heres some screenshots first:







    Heres the source code:

    Code:
    ' *************************************************************************************
    '                       Code Generated by EZGUI Visual Designer 4.0
    '                       Portions: Copyright Christopher R. Boss, 2003 to 2006
    '                                    All Rights Reserved !
    '                 Registered EZGUI 4.0 users may use this code Royalty Free !
    ' *************************************************************************************
    '
    ' --------------------------------------------------------
    ' WARNING ! Do Not Modify any code WITHIN Protected Sections !
    ' You can add code (Sub,Function,etc.) BEFORE any Protected Routine
    ' by using the following CODE TAGS:        '<<SAVE>>      '<<END>>
    ' and the Designer will not remove it.
    ' --------------------------------------------------------
    '
    ' ======================================
    ' [PROTECTED CODE]         Do NOT Edit !
    ' ======================================
     
    '
    #COMPILE EXE
    #DIM ALL        '   This is helpful to prevent errors in coding
    ' ------------------------------
    ' Enable all constants below to
    ' customize maximums in EZGUI
    ' runtime.
    ' ------------------------------
    ' %EZGUI_MaxColors    =   800
    ' %EZGUI_MaxFonts     =   800
    ' %EZGUI_MaxImages    =   300
    ' %EZGUI_MaxControls  =   1500
    ' %EZGUI_MaxForms     =   150
    ' %EZGUI_MaxMenus     =   200
    ' ------------------------------
    ' --------------------
    #INCLUDE "C:\ezgui40pro\includes\ezgui40.inc"                          ' EZGUI Include file for Declares
    ' --------------------
    ' *************************************************************************************
     
    ' *************************************************************************************
    '                   Code Generator Defined Constants and Declares
    ' *************************************************************************************
    DECLARE FUNCTION Main_Initialize(BYVAL VerNum&) AS LONG
    DECLARE SUB OtherForm_Events(FormName$, CID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB OtherForm_Design(FormName$)
    DECLARE FUNCTION PreProcess_Events(FormName$, CID&, CMsg&, CVal&, Cancel&) AS LONG
    DECLARE SUB EZ_MDIPARENT_Display(BYVAL Parent$)
    DECLARE SUB EZ_MDIPARENT_Design()
    DECLARE SUB EZ_MDIPARENT_ParseEvents(CID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB MDIPARENT_Events(CID&, CMsg&, CVal&, Cancel&)
    ' ------------------------------------------------
     
    ' ----------------------------------------------------------
    %MDIPARENT_MENUFILES                              = 9000
    ' ----------------------------------------------------------
    %MDIPARENT_MENUNEW                                = 9005
    %MDIPARENT_MENUOPEN                               = 9010
    %MDIPARENT_MENUSAVE                               = 9015
    %MDIPARENT_MENUCLOSE                              = 9020
    %MDIPARENT_SEPARATOR_9025                         = 9025
    %MDIPARENT_MENUPSETUP                             = 9030
    %MDIPARENT_MENUPRINT                              = 9035
    %MDIPARENT_MENUPPREVIEW                           = 9040
    %MDIPARENT_SEPARATOR_9045                         = 9045
    %MDIPARENT_MENUEXIT                               = 9050
    ' ----------------------------------------------------------
    %MDIPARENT_MENUEDIT                               = 9100
    ' ----------------------------------------------------------
    %MDIPARENT_MENUCOPY                               = 9105
    %MDIPARENT_MENUCUT                                = 9110
    %MDIPARENT_MENUPASTE                              = 9115
    ' ----------------------------------------------------------
    %MDIPARENT_MENUWIN                                = 9200
    ' ----------------------------------------------------------
    %MDIPARENT_MENUTILE                               = 9205
    %MDIPARENT_REBAR1             = 100
    %MDIPARENT_MDICLIENT1         = 25
    %MDIPARENT_STATUSBAR          = 110
    DECLARE SUB MDIPARENT_REBAR1_Events(MyID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB EZ_MDICHILD_Display(BYVAL Parent$, BYVAL AC!, BYVAL AR!)
    DECLARE SUB EZ_MDICHILD_Design()
    DECLARE SUB EZ_MDICHILD_ParseEvents(CID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB MDICHILD_Events(CID&, CMsg&, CVal&, Cancel&)
    ' ------------------------------------------------
    %MDICHILD_TEXT1              = 100
    DECLARE SUB MDICHILD_EditSetSel(BYVAL CVal&)
    DECLARE SUB MDICHILD_TEXT1_Load(BYVAL Mode&, BYVAL D$)
    DECLARE SUB MDICHILD_TEXT1_Events(MyID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB MDICHILD_TEXT1_EditSetSel(BYVAL CVal&)
    DECLARE SUB MDICHILD_TEXT1_SubClass(BYVAL CVal&, Cancel&)
    DECLARE SUB EZ_PPFORM_Display(BYVAL Parent$)
    DECLARE SUB EZ_PPFORM_Design()
    DECLARE SUB EZ_PPFORM_ParseEvents(CID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB PPFORM_Events(CID&, CMsg&, CVal&, Cancel&)
    ' ------------------------------------------------
    %PPFORM_NEXTPAGE           = 100
    %PPFORM_PREVPAGE           = 105
    %PPFORM_PRINTPAGE          = 110
    %PPFORM_CLOSEPREVIEW       = 115
    %PPFORM_LABEL1             = 120
    %PPFORM_CANVAS1            = 125
    DECLARE SUB PPFORM_NEXTPAGE_Events(MyID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB PPFORM_PREVPAGE_Events(MyID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB PPFORM_PRINTPAGE_Events(MyID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB PPFORM_CLOSEPREVIEW_Events(MyID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB PPFORM_CANVAS1_Draw(BYVAL Mode&)
    DECLARE SUB EZ_TBAR1_Display(BYVAL FormName$, BYVAL RebarID&, BYVAL BText$, BYVAL ImgIndex&, BYVAL HWidth&, BYVAL BGPict$, BYVAL BProp$)
    DECLARE SUB EZ_TBAR1_Design()
    DECLARE SUB EZ_TBAR1_ParseEvents(CID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB TBAR1_Events(CID&, CMsg&, CVal&, Cancel&)
    ' ------------------------------------------------
    %TBAR1_TOOLBAR1           = 50
    DECLARE SUB TBAR1_TOOLBAR1_Events(BYVAL TBarID&, MyID&, BYVAL ButtonN&, CMsg&, CVal&, Cancel&)
    DECLARE SUB EZ_TBAR2_Display(BYVAL FormName$, BYVAL RebarID&, BYVAL BText$, BYVAL ImgIndex&, BYVAL HWidth&, BYVAL BGPict$, BYVAL BProp$)
    DECLARE SUB EZ_TBAR2_Design()
    DECLARE SUB EZ_TBAR2_ParseEvents(CID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB TBAR2_Events(CID&, CMsg&, CVal&, Cancel&)
    ' ------------------------------------------------
    %TBAR2_BOLDBUTTON         = 100
    %TBAR2_ITALICBUTTON       = 105
    %TBAR2_UNDERBUTTON        = 110
    %TBAR2_FONTNAMES          = 115
    %TBAR2_FONTSIZES          = 120
    %TBAR2_FONTCOLORS         = 125
    %TBAR2_LEFTBUTTON         = 130
    %TBAR2_CENTERBUTTON       = 135
    %TBAR2_RIGHTBUTTON        = 140
    DECLARE SUB TBAR2_BOLDBUTTON_Events(MyID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB TBAR2_ITALICBUTTON_Events(MyID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB TBAR2_UNDERBUTTON_Events(MyID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB TBAR2_FONTNAMES_Events(MyID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB TBAR2_FONTSIZES_Events(MyID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB TBAR2_FONTCOLORS_Events(MyID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB TBAR2_LEFTBUTTON_Events(MyID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB TBAR2_CENTERBUTTON_Events(MyID&, CMsg&, CVal&, Cancel&)
    DECLARE SUB TBAR2_RIGHTBUTTON_Events(MyID&, CMsg&, CVal&, Cancel&)
     
    ' *************************************************************************************
    '                 Code Generator Defined Global Variables and Types
    ' *************************************************************************************
     
    '    Note:     Do NOT change the names of the EZGUI Callback Procedures !
    ' --------------------
    #INCLUDE "C:\ezgui40pro\includes\ezwmain.inc"                          ' EZGUI Include file for WinMain
    ' --------------------
     
    ' *************************************************************************************
    '                       User Defined Global Variables and Types
    '         (Put code in CODE TAGS! to protect from deletion by Code Generator !)
    ' *************************************************************************************
     
    '<<SAVE>>
    GLOBAL App_BoldState&
    GLOBAL App_ItalicState&
    GLOBAL App_UnderState&
    GLOBAL App_FontName$
    GLOBAL App_FontSize!
    GLOBAL App_FontProp$
    GLOBAL App_FontColor&
    GLOBAL App_LeftAlign&
    GLOBAL App_CenterAlign&
    GLOBAL App_RightAlign&
    GLOBAL App_CurrentPage&
    GLOBAL App_PageCount&
    '<<END>>
    SUB EZ_Main(VerNum&)     ' (PROTECTED)
         EZ_Reg %EZ_CUSTID,%EZ_REGNUM
         EZ_DefImageFolder "Graphics"
         EZ_AllowCommandEvents  0
         EZ_LoadImageLib ""
         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, 16
         EZ_DefSystemColor 33, 21
         EZ_DefSystemColor 34, 15
         EZ_DefSystemColor 35, 18
         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_MDIPARENT_Display ""
         END IF
    END SUB
    ' -------------------------------------------------------------------------------------
    SUB EZ_DesignWindow(FormName$)     ' (PROTECTED)
         SELECT CASE FormName$
              CASE "MDIPARENT"
                   EZ_MDIPARENT_Design
              CASE "MDICHILD"
                   EZ_MDICHILD_Design
              CASE "PPFORM"
                   EZ_PPFORM_Design
              CASE "TBAR1"
                   EZ_TBAR1_Design
              CASE "TBAR2"
                   EZ_TBAR2_Design
              CASE ELSE
                   OtherForm_Design FormName$
         END SELECT
    END SUB
    ' -------------------------------------------------------------------------------------
    SUB EZ_Events(FormName$, CID&, CMsg&, CVal&, Cancel&)     ' (PROTECTED)
         IF PreProcess_Events(FormName$, CID&, CMsg&, CVal&, Cancel&) THEN EXIT SUB
         SELECT CASE FormName$
              CASE "MDIPARENT"
                   EZ_MDIPARENT_ParseEvents CID&, CMsg&, CVal&, Cancel&
              CASE "MDICHILD"
                   EZ_MDICHILD_ParseEvents CID&, CMsg&, CVal&, Cancel&
              CASE "PPFORM"
                   EZ_PPFORM_ParseEvents CID&, CMsg&, CVal&, Cancel&
              CASE "TBAR1"
                   EZ_TBAR1_ParseEvents CID&, CMsg&, CVal&, Cancel&
              CASE "TBAR2"
                   EZ_TBAR2_ParseEvents CID&, CMsg&, CVal&, Cancel&
              CASE ELSE
                   OtherForm_Events FormName$, CID&, CMsg&, CVal&, Cancel&
         END SELECT
    END SUB
    ' -------------------------------------------------------------------------------------
         ' my library stuff
    ' *************************************************************************************
    '                                Applications FORM Code
    ' *************************************************************************************
    ' ======================================
    ' [USER ACCESSABLE CODE]  You may Edit !
    ' ======================================
    FUNCTION Main_Initialize(BYVAL VerNum&) AS LONG
         LOCAL RV&
         EZ_DefSystemColor 99, 8  ' define Window text color
         EZ_DefSystemColor 46, 13
         EZ_DefSystemColor 47, 14
         RV&=1
         FUNCTION=RV&
    END FUNCTION
     
    SUB OtherForm_Design(FormName$)
         SELECT CASE FormName$
              CASE ELSE
         END SELECT
    END SUB
     
    SUB OtherForm_Events(FormName$, CID&, CMsg&, CVal&, Cancel&)
         SELECT CASE FormName$
              CASE "{OPENDLG}", "{SAVEDLG}", "{OPENDLGX}", "{SAVEDLGX}", "{COLORDLG}", "{FONTDLG}", "{PRINTDLG}", "{PAGEDLG}", "{FINDDLG}"
                   SELECT CASE CID&
                        CASE %EZ_Window
                             SELECT CASE CMsg&
                                  CASE %EZ_Loaded
                                       EZ_CenterForm "Main", FormName$,0
                                  CASE ELSE
                             END SELECT
                        CASE ELSE
                             SELECT CASE CMsg&
                                  CASE %EZ_OwnerDraw
                                       EZ_Draw3DButtonRR FormName$, CID&, CVal&, 34, 35,  4
                             END SELECT
                   END SELECT
              CASE "{ABORTDLG}"
              CASE "{MSGBOX}"
              CASE ELSE
         END SELECT
    END SUB
     
    FUNCTION PreProcess_Events(FormName$, CID&, CMsg&, CVal&, Cancel&) AS LONG
         LOCAL RV&
         RV&=0
         FUNCTION=RV&
    END FUNCTION
     
    '<<BEGINFORM>> "MDIPARENT"
     
    ' ======================================
    ' [PROTECTED CODE]         Do NOT Edit !
    ' ======================================
    SUB EZ_MDIPARENT_Display(BYVAL Parent$)     ' (PROTECTED)
         LOCAL hMainMenu&
         ' Main Menu handle automatically stored by EZGUI
         hMainMenu&=EZ_DefMainMenu( %MDIPARENT_MENUFILES, "&File", "")
         EZ_Color -1, -1
         EZ_Form "MDIPARENT", Parent$, "EZGUI Rich Text Editor", 0, 0, 85, 32, "^_CZ{MDI-P}"
    END SUB
    SUB EZ_MDIPARENT_Design()     ' (PROTECTED)
         LOCAL CText$
         LOCAL hMainMenu&, hDropMenu&, hSubMenu&
         hMainMenu&=EZ_GetMenu("MDIPARENT", 0)
         EZ_AddMenuItem hMainMenu&, %MDIPARENT_MENUEDIT, 0, "&Edit", ""
         EZ_AddMenuItem hMainMenu&, %MDIPARENT_MENUWIN, 0, "&Windows", ""
         hDropMenu&=EZ_DefSubMenu( %MDIPARENT_MENUNEW, "&New File", "")
         EZ_SaveMenu "MDIPARENT", 1, hDropMenu&
         EZ_SetSubMenu hMainMenu& , %MDIPARENT_MENUFILES, hDropMenu&
         EZ_AddMenuItem hDropMenu&, %MDIPARENT_MENUOPEN, 0, "&Open File", ""
         EZ_AddMenuItem hDropMenu&, %MDIPARENT_MENUSAVE, 0, "&Save File", ""
         EZ_AddMenuItem hDropMenu&, %MDIPARENT_MENUCLOSE, 0, "&Close File", ""
         EZ_AddMenuItem hDropMenu&, %MDIPARENT_SEPARATOR_9025, 0, "-", ""
         EZ_AddMenuItem hDropMenu&, %MDIPARENT_MENUPSETUP, 0, "Printer S&etup", ""
         EZ_AddMenuItem hDropMenu&, %MDIPARENT_MENUPRINT, 0, "&Print", ""
         EZ_AddMenuItem hDropMenu&, %MDIPARENT_MENUPPREVIEW, 0, "Print Previe&w", ""
         EZ_AddMenuItem hDropMenu&, %MDIPARENT_SEPARATOR_9045, 0, "-", ""
         EZ_AddMenuItem hDropMenu&, %MDIPARENT_MENUEXIT, 0, "E&xit", ""
         hDropMenu&=EZ_DefSubMenu( %MDIPARENT_MENUCOPY, "&Copy", "")
         EZ_SaveMenu "MDIPARENT", 2, hDropMenu&
         EZ_SetSubMenu hMainMenu& , %MDIPARENT_MENUEDIT, hDropMenu&
         EZ_AddMenuItem hDropMenu&, %MDIPARENT_MENUCUT, 0, "Cu&t", ""
         EZ_AddMenuItem hDropMenu&, %MDIPARENT_MENUPASTE, 0, "&Paste", ""
         hDropMenu&=EZ_DefSubMenu( %MDIPARENT_MENUTILE, "&Tile Windows", "M")
         EZ_SaveMenu "MDIPARENT", 3, hDropMenu&
         EZ_SetSubMenu hMainMenu& , %MDIPARENT_MENUWIN, hDropMenu&
         ' ------------------------------------------------
         EZ_Color-1,-1
         EZ_UseFont 4
         EZ_SubClass 2
         EZ_Rebar %MDIPARENT_REBAR1, 0, 0, 0,  2, 0, "?^AFV["
         EZ_SubClass 0
         ' -----------------------------------------------
         EZ_Color-1,-1
         EZ_UseFont 4
         EZ_MDIClient
         ' -----------------------------------------------
         EZ_Color -1,-1
         EZ_UseFont 4
         EZ_AllowLoadingEvent 2
         EZ_StatusBar %MDIPARENT_STATUSBAR, "", ""
         EZ_ResizeMDI "MDIParent", 0, 2, 85, 28.75, 0
    END SUB
    ' ======================================
    ' [USER ACCESSABLE CODE]  You may Edit !
    ' ======================================
    '<<SAVE>>
    DECLARE SUB PrintRTF(BYVAL PForm$, BYVAL FormName$, BYVAL ID&, BYVAL CFormName$, BYVAL CanvasID&, BYVAL PageNum&, PageCount&)
    SUB ResetFocus()
         EZ_SetFocus "MDIChild", %MDICHILD_TEXT1
    END SUB
    SUB UpdateFontBar()
         LOCAL TFace$, APSize!, FProp$, FColor&, I&, PT&, N&, ACN&, BFlag1&, BFlag2&, BFlag3&
         EZ_GetRichFont "MDIChild", %MDICHILD_TEXT1, TFace$, APSize!, FProp$, FColor&, 1
         IF TFace$<>App_FontName$ THEN
              App_FontName$=TFace$
              I&=EZ_FindNextLeft("TBAR2",%TBAR2_FONTNAMES,TFace$+"<", 0)
              IF I&>=0 THEN
                   EZ_SelectItem "TBAR2",%TBAR2_FONTNAMES, I&
              END IF
         END IF
         PT&=ABS(APSize!)
         IF PT&>=1 AND PT&<=127 THEN
              IF PT&<>ABS(App_FontSize!) THEN
                   App_FontSize!=PT&
                   EZ_SelectItem "TBAR2",%TBAR2_FONTSIZES, PT&-1
              END IF
         END IF
         ACN&=-1
         IF FColor&=-1 THEN
              ACN&=16
         ELSE
              FOR N&=0 TO 15
                   IF FColor&=EZ_ColorVal(N&,0) THEN
                        ACN&=N&
                        EXIT FOR
                   END IF
              NEXT N&
         END IF
         IF App_FontColor&<>FColor& THEN
              IF ACN&>=0 THEN
                   EZ_SelectItem "TBAR2", %TBAR2_FONTCOLORS, ACN&
              ELSE
                   ' erase custom color and reset it.
                   EZ_DeleteItem "TBAR2", %TBAR2_FONTCOLORS, 17
                   EZ_AddItems "TBAR2", %TBAR2_FONTCOLORS, "<&H"+HEX$(FColor&,8)+">   Custom"
                   EZ_SelectItem "TBAR2", %TBAR2_FONTCOLORS, 17
              END IF
              App_FontColor&=FColor&
         END IF
         IF INSTR(FProp$,"B") THEN BFlag1&=1 ELSE BFlag1&=0
         IF BFlag1&<>App_BoldState& THEN
              App_BoldState&=BFlag1&
              EZ_RedrawControl "TBAR2", %TBAR2_BOLDBUTTON
         END IF
         IF INSTR(FProp$,"I") THEN BFlag2&=1 ELSE BFlag2&=0
         IF BFlag2&<>App_ItalicState& THEN
              App_ItalicState&=BFlag2&
              EZ_RedrawControl "TBAR2", %TBAR2_ITALICBUTTON
         END IF
         IF INSTR(FProp$,"U") THEN BFlag3&=1 ELSE BFlag3&=0
         IF BFlag3&<>App_UnderState& THEN
              App_UnderState&=BFlag3&
              EZ_RedrawControl "TBAR2", %TBAR2_UNDERBUTTON
         END IF
         App_FontProp$=""
         IF App_BoldState& THEN App_FontProp$=App_FontProp$+"B"
         IF App_ItalicState& THEN App_FontProp$=App_FontProp$+"I"
         IF App_UnderState& THEN App_FontProp$=App_FontProp$+"U"
    END SUB
    SUB UpdateAlignmentBar()
         LOCAL BFlag&, I!, LI!, RI!, AL$, TabList$, RFlag&
         EZ_GetRichPar "MDIChild", %MDICHILD_TEXT1, BFlag&, I!, LI!, RI!, AL$, TabList$
         RFlag&=0
         IF AL$="L" THEN
              IF App_LeftAlign&=0 THEN
                   App_LeftAlign&      =1
                   App_CenterAlign&    =0
                   App_RightAlign&     =0
                   RFlag&=1
              END IF
         END IF
         IF AL$="C" THEN
              IF App_CenterAlign&=0 THEN
                   App_LeftAlign&      =0
                   App_CenterAlign&    =1
                   App_RightAlign&     =0
                   RFlag&=1
              END IF
         END IF
         IF AL$="R" THEN
              IF App_RightAlign&=0 THEN
                   App_LeftAlign&      =0
                   App_CenterAlign&    =0
                   App_RightAlign&     =1
                   RFlag&=1
              END IF
         END IF
         IF RFlag& THEN
              EZ_RedrawControl "TBAR2", %TBAR2_LEFTBUTTON
              EZ_RedrawControl "TBAR2", %TBAR2_CENTERBUTTON
              EZ_RedrawControl "TBAR2", %TBAR2_RIGHTBUTTON
         END IF
    END SUB
    SUB DefFirstFont()
         ResetFocus
         EZ_DoEvents 25
         EZ_SetRichSel  "MDIChild", %MDICHILD_TEXT1, 0,0
         EZ_SetRichFont "MDIChild", %MDICHILD_TEXT1, "Arial", 10.0, "", -1, "BIU-^", 0
         EZ_SetRichPar "MDIChild", %MDICHILD_TEXT1, 0,  0, 0, 0, "L", ".5|.5|.5|.5|.5|", "AT"
         ' set values so all fields forced to redraw
         App_FontName$=""
         App_FontSize!=0
         App_FontProp$=""
         App_FontColor&=0
         App_BoldState&=0
         App_ItalicState&=0
         App_UnderState&=0
         App_LeftAlign&=0
         App_CenterAlign&=0
         App_RightAlign&=0
         UpdateFontBar
         UpdateAlignmentBar
    END SUB
    SUB ChangeFontEffect(BYVAL Mode&, BYVAL CVal&)
         LOCAL FontName$, FontSize!, FontProp$, FontColor&, Mask$, MyColor&, C$, P1&, P2&
         EZ_GetRichSel  "MDIChild", %MDICHILD_TEXT1, P1&, P2&
         Mask$=""
         FontName$=""
         FontSize!=-1
         FontProp$=""
         FontColor&=-2
         SELECT CASE Mode&
              CASE 1    ' Bold
                   IF App_BoldState&=0 THEN
                        FontProp$="B"
                   END IF
                   Mask$="B"
              CASE 2    ' Italic
                   IF App_ItalicState&=0 THEN
                        FontProp$="I"
                   END IF
                   Mask$="I"
              CASE 3    ' Underline
                   IF App_UnderState&=0 THEN
                        FontProp$="U"
                   END IF
                   Mask$="U"
              CASE 4    ' font name
                  FontName$=EZ_GetItemText("TBAR2",%TBAR2_FONTNAMES, CVal&)
                  FontName$=PARSE$(FontName$, "<", 1)
              CASE 5    ' font size
                   FontSize!=CVal&+1
              CASE 6    ' font color
                   SELECT CASE CVal&
                        CASE 0 TO 15
                             FontColor&=EZ_ColorVal(CVal&,0)
                        CASE 16
                             FontColor&=-1
                        CASE 17
                             C$=EZ_GetItemText("TBAR2", %TBAR2_FONTCOLORS, 17)
                             C$=PARSE$(C$,">", 1)
                             C$=TRIM$(REMOVE$(C$, "<"))
                             MyColor&=VAL(C$)
                             FontColor&=MyColor&
                             IF EZ_ChooseColor("MDIParent", MyColor&, "") THEN
                                  FontColor&=MyColor&
                             END IF
                        CASE ELSE
                             EXIT SUB
                   END SELECT
              CASE ELSE
         END SELECT
         ResetFocus
         EZ_DoEvents 25
         EZ_SetRichSel  "MDIChild", %MDICHILD_TEXT1, P1&, P2&
         EZ_SetRichFont "MDIChild", %MDICHILD_TEXT1, FontName$, FontSize!, FontProp$, FontColor&, Mask$, 1
         UpdateFontBar
    END SUB
    SUB ChangeParEffect(BYVAL Mode&)
         LOCAL P1&, P2& , AL$
         EZ_GetRichSel  "MDIChild", %MDICHILD_TEXT1, P1&, P2&
         SELECT CASE Mode&
              CASE 0
                   IF App_LeftAlign&=0 THEN
                        AL$="L"
                   END IF
              CASE 1
                   IF App_CenterAlign&=0 THEN
                        AL$="C"
                   END IF
              CASE 2
                   IF App_RightAlign&=0 THEN
                        AL$="R"
                   END IF
              CASE ELSE
                   EXIT SUB
         END SELECT
         ResetFocus
         EZ_DoEvents 25
         EZ_SetRichSel  "MDIChild", %MDICHILD_TEXT1, P1&, P2&
         EZ_SetRichPar "MDIChild", %MDICHILD_TEXT1, 0,  0, 0, 0, AL$, "", "A"  ' set alignment only
         UpdateAlignmentBar
    END SUB
    SUB DoFileAccess(BYVAL F$, BYVAL Mode&)
         LOCAL T$, AFN%
         AFN%=FREEFILE
         IF Mode&=1 THEN
              IF DIR$(F$)<>"" THEN KILL F$
              T$=EZ_GetRichText("MDIChild",%MDICHILD_TEXT1,1,0)
         ELSE
              IF DIR$(F$)="" THEN EXIT SUB
              T$=""
         END IF
         OPEN F$ FOR BINARY AS AFN%
         IF Mode&=1 THEN
              PUT$ AFN%, T$
         ELSE
              GET$ AFN%, LOF(AFN%), T$
              EZ_SetRichText "MDIChild",%MDICHILD_TEXT1,T$, 1,0
              UpdateFontBar
              UpdateAlignmentBar
         END IF
         CLOSE AFN%
         EZ_SetText "MDIChild",0, F$
    END SUB
    SUB DoTextFile(BYVAL Mode&)
         LOCAL AF$, F$
         SELECT CASE Mode&
              CASE 0    ' New file
                   GOSUB TestForForm
                   DefFirstFont
                   EZ_SetRichText "MDIChild",%MDICHILD_TEXT1,"", 1,0
                   EZ_SetText "MDIChild", 0, "newtext.txt"
              CASE 1    ' Open
                   GOSUB TestForForm
                   EZ_ChangeDlgButtons -2
                   F$=EZ_OpenFile("MDIParent","Select Rich Text File","", "Text (*.rtf))|*.rtf|All Files (*.*)|*.*|","ZI")
                   IF F$<>"" THEN
                        DoFileAccess F$, 0
                   END IF
              CASE 2,3    ' save
                   IF EZ_Handle("MDIChild",0)<>0 THEN
                        IF EZ_IsForm("MDIChild", "Min") THEN EZ_MaximizeForm  "MDIChild"
                        AF$=EZ_GetText("MDIChild",0)
                        EZ_ChangeDlgButtons -2
                        F$=EZ_SaveFile("MDIParent","Save Rich Text File","", AF$, "Text (*.rtf))|*.rtf|All Files (*.*)|*.*|","rtf", "PNIZ")
                        IF F$<>"" THEN
                             DoFileAccess F$, 1
                        END IF
                        IF Mode&=3 THEN EZ_UnloadForm "MDIChild"
                   END IF
         END SELECT
         EXIT SUB
         TestForForm:
              IF EZ_Handle("MDIChild",0)=0 THEN
                   EZ_MDIchild_Display "MDIParent", 0,0
                   EZ_MaximizeForm "MDIChild"
              END IF
              IF EZ_IsForm("MDIChild", "Min") THEN EZ_MaximizeForm  "MDIChild"
         RETURN
    END SUB
    SUB DoMenuEdit(BYVAL Mode&)
         LOCAL P1&, P2&, T$
         EZ_GetRichSel  "MDIChild", %MDICHILD_TEXT1, P1&, P2&
         SELECT CASE Mode&
              CASE 0    ' copy
                   T$ = EZ_GetRichText("MDIChild", %MDICHILD_TEXT1, 1,1 )
                   EZ_SetClipboardFormat 2
                   EZ_SetClipboard T$
              CASE 1    ' cut
                   EZ_SetRichText "MDIChild", %MDICHILD_TEXT1,"", 1,1
                   P2&=P1&
              CASE 2    ' paste
                   IF P2&>P1& THEN
                        EZ_SetRichText "MDIChild", %MDICHILD_TEXT1,"", 1,1
                        EZ_SetRichSel  "MDIChild", %MDICHILD_TEXT1, P1&, P1&
                   END IF
                   EZ_SetClipboardFormat 2
                   T$=EZ_GetClipboard
                   EZ_SetRichText "MDIChild", %MDICHILD_TEXT1,T$, 1,1
                   EZ_SetClipboardFormat 0
                   T$=EZ_GetClipboard
                   P2&=P1&+LEN(T$)
              CASE ELSE
                   EXIT SUB
         END SELECT
         ResetFocus
         EZ_DoEvents 25
         EZ_SetRichSel  "MDIChild", %MDICHILD_TEXT1, P1&, P2&
         UpdateFontBar
         UpdateAlignmentBar
    END SUB
    SUB DoPrint(BYVAL Mode&)
         LOCAL PageCount&
         SELECT CASE Mode&
              CASE 0    ' printer setup
                   DIM EZP AS EZPAGE, OK&
                   EZP.UseMetric            =0
                   EZP.UseDefaultMargins    =1
                   EZP.DisableMargins       =0
                   EZP.LeftMargin           =0
                   EZP.TopMargin            =0
                   EZP.RightMargin          =0
                   EZP.BottomMargin         =0
                   EZ_ChangeDlgButtons -2
                   OK& = EZ_PageSetup("MDIParent", EZP )
              CASE 1    ' print
                   App_PageCount&=0
                   PrintRTF "MDIParent", "MDIChild", %MDICHILD_TEXT1, "", 0, 0, PageCount&
              CASE 2    ' print preview
                   App_CurrentPage&=1
                   App_PageCount&=0
                   EZ_PPForm_Display "MDIParent"
              CASE ELSE
         END SELECT
         App_CurrentPage&=0
         App_PageCount&=0
    END SUB
    SUB PrintRTF(BYVAL PForm$, BYVAL FormName$, BYVAL ID&, BYVAL CFormName$, BYVAL CanvasID&, BYVAL PageNum&, PageCount&)
         LOCAL X&,Y&,W&,H&, StartChar&, LastChar&, CT&, FW!, FH!, T$, RX&, RY&
         LOCAL EZP AS EZPRINTER, RV&, Border&, PPFlag&, OKFlag&
         PageCount&=0
         IF CFormName$<>"" THEN
              IF EZ_Handle(CFormName$, CanvasID&)=0 THEN EXIT SUB
              PPFlag&=1
         ELSE
              PPFlag&=0
         END IF
         IF EZ_Handle(FormName$, ID&)=0 THEN EXIT SUB
         EZP.PrintWhat=1     ' Print All
         EZP.AllowPages=1
         EZP.AllowSelection=1
         EZP.CollateFlag=0
         IF PPFlag& THEN
              EZP.FromPage=PageNum&
              EZP.ToPage=PageNum&
         ELSE
              EZP.FromPage=1
              EZP.ToPage=999
         END IF
         EZP.MinPage=1
         EZP.MaxPage=999
         EZP.PUnits=1   ' must use anything but pixels here
         EZ_Color -1,-1
         PageCount&=0
         IF PPFlag& THEN
              EZP.PrnPaperSize=1  ' required when printing to a Canvas control !
              IF EZ_ChooseCanvas(CFormName$, CanvasID&, EZP) THEN
                   GOSUB DoPrintPages
              END IF
         ELSE
              EZ_ChangeDlgButtons -2
              IF EZ_ChoosePrinter(PForm$, EZP) THEN
                   GOSUB DoPrintPages
              END IF
         END IF
         EZ_SetForm PForm$, 1
    EXIT SUB
    DoPrintPages:
       EZ_StartDoc "My Document 1"        ' Automatically displays the Abort Dialog
       RX&=(EZP.PWidth-EZP.AWidth)/2       ' difference between full page and what can be printed on
       RY&=(EZP.PHeight-EZP.AHeight)/2     ' difference between full page and what can be printed on
       Border&=EZP.DPIx/2  ' 1/2 inch border
       X&=Border&-RX&
       Y&=Border&-RY&
       W&=EZP.AWidth-(2*X&)-1      ' actual width of page - border
       H&=EZP.AHeight-(2*Y&)-1     ' actual height of page - border
       LastChar&=EZ_GetRichTextLen(FormName$, ID&, 0,0)
       LastChar&=LastChar&-1
       StartChar&=0
       EZ_SaveState
       DO
            IF StartChar&>LastChar& THEN EXIT DO
            ' simply test for printable text
            RV& = EZ_LPrintRichText(FormName$, ID&,_
                                    X&, Y&, W&, H&, _
                                    StartChar&, -1, -1)
            IF RV&<=0 THEN EXIT DO
            PageCount&=PageCount&+1
            OKFlag&=0
            SELECT CASE EZP.PrintWhat
                 CASE 1 ' print all    (uses this when printing to Canvas too)
                      OKFlag&=1
                 CASE 2 ' print pages  (only printer mode will change to this)
                      IF PageCount&>=EZP.FromPage AND PageCount&<=EZP.ToPage THEN
                           OKFlag&=1
                      ELSE
                           StartChar&=RV&
                      END IF
                 CASE ELSE
                      OKFlag&=0
            END SELECT
            IF OKFlag& THEN
                 EZ_StartPage
                 EZ_DefFont 99, "Arial", 10, "VBP"
                 ' now print the text
                 StartChar& = EZ_LPrintRichText(FormName$, ID&,_
                                                X&, Y&, W&, H&, _
                                                StartChar&, -1, 0)
                 T$="PG "+TRIM$(STR$(PageCount&))
                 EZ_GetTextSize 99, "0000000", FW!, FH!, 2
                 EZ_SetPrintFormat 0,0,0,0,0
                 EZ_Color 0,15
                 EZ_UseFont 99
                 EZ_LPrint X&+W&-FW!, Y&+H&-FH!, T$
                 EZ_FreeFont 99
                 EZ_EndPage
            END IF
            CT&=CT+1
            IF CT&>=1000 THEN EXIT DO   ' fail safe to prevent infinite loop
            IF StartChar&<=0 THEN EXIT DO
       LOOP
       EZ_RestoreState
       EZ_LPrintRichText FormName$, ID&,0,0,0,0,0,0,1
       EZ_EndDoc        ' Automatically Unloads the Abort Dialog
    RETURN
    END SUB
    '<<END>>
    SUB MDIPARENT_MenuEvents(BYVAL MyID&, CMsg&, CVal&, Cancel&, BYVAL hMenu&, BYVAL MenuText$)
         SELECT CASE MyID&
              CASE %MDIPARENT_MENUFILES
                   SELECT CASE CMsg&
                        CASE %EZ_Click
                        CASE %EZ_Selected
                   END SELECT
              CASE %MDIPARENT_MENUNEW
                   SELECT CASE CMsg&
                        CASE %EZ_Click
                             DoTextFile 0
                        CASE %EZ_Selected
                   END SELECT
              CASE %MDIPARENT_MENUOPEN
                   SELECT CASE CMsg&
                        CASE %EZ_Click
                             DoTextFile 1
                        CASE %EZ_Selected
                   END SELECT
              CASE %MDIPARENT_MENUSAVE
                   SELECT CASE CMsg&
                        CASE %EZ_Click
                             DoTextFile 2
                        CASE %EZ_Selected
                   END SELECT
              CASE %MDIPARENT_MENUCLOSE
                   SELECT CASE CMsg&
                        CASE %EZ_Click
                             DoTextFile 3
                        CASE %EZ_Selected
                   END SELECT
              CASE %MDIPARENT_MENUPSETUP
                   SELECT CASE CMsg&
                        CASE %EZ_Click
                             DoPrint 0
                        CASE %EZ_Selected
                   END SELECT
              CASE %MDIPARENT_MENUPRINT
                   SELECT CASE CMsg&
                        CASE %EZ_Click
                             DoPrint 1
                        CASE %EZ_Selected
                   END SELECT
              CASE %MDIPARENT_MENUPPREVIEW
                   SELECT CASE CMsg&
                        CASE %EZ_Click
                             DoPrint 2
                        CASE %EZ_Selected
                   END SELECT
              CASE %MDIPARENT_MENUEXIT
                   SELECT CASE CMsg&
                        CASE %EZ_Click
                             DoTextFile 2
                             EZ_UnloadForm "MDIParent"
                        CASE %EZ_Selected
                   END SELECT
              CASE %MDIPARENT_MENUEDIT
                   SELECT CASE CMsg&
                        CASE %EZ_Click
                        CASE %EZ_Selected
                   END SELECT
              CASE %MDIPARENT_MENUCOPY
                   SELECT CASE CMsg&
                        CASE %EZ_Click
                             DoMenuEdit 0
                        CASE %EZ_Selected
                   END SELECT
              CASE %MDIPARENT_MENUCUT
                   SELECT CASE CMsg&
                        CASE %EZ_Click
                             DoMenuEdit 1
                        CASE %EZ_Selected
                   END SELECT
              CASE %MDIPARENT_MENUPASTE
                   SELECT CASE CMsg&
                        CASE %EZ_Click
                             DoMenuEdit 2
                        CASE %EZ_Selected
                   END SELECT
              CASE %MDIPARENT_MENUWIN
                   SELECT CASE CMsg&
                        CASE %EZ_Click
                        CASE %EZ_Selected
                   END SELECT
              CASE %MDIPARENT_MENUTILE
                   SELECT CASE CMsg&
                        CASE %EZ_Click
                        CASE %EZ_Selected
                   END SELECT
              CASE ELSE
         END SELECT
    END SUB
     
    ' ======================================
    ' [PROTECTED CODE]         Do NOT Edit !
    ' ======================================
     
    SUB EZ_MDIPARENT_ParseEvents(CID&, CMsg&, CVal&, Cancel&)     ' (PROTECTED)
         SELECT CASE CID&
              CASE %EZ_Window
                   MDIPARENT_Events CID&, CMsg&, CVal&, Cancel&
              CASE %MDIPARENT_MENUFILES
                   MDIPARENT_MenuEvents CID&, CMsg&, CVal&, Cancel&, EZ_GetMenu("MDIPARENT", 0), "&File"
              CASE %MDIPARENT_MENUNEW
                   MDIPARENT_MenuEvents CID&, CMsg&, CVal&, Cancel&, EZ_GetMenu("MDIPARENT", 1), "&New File"
              CASE %MDIPARENT_MENUOPEN
                   MDIPARENT_MenuEvents CID&, CMsg&, CVal&, Cancel&, EZ_GetMenu("MDIPARENT", 1), "&Open File"
              CASE %MDIPARENT_MENUSAVE
                   MDIPARENT_MenuEvents CID&, CMsg&, CVal&, Cancel&, EZ_GetMenu("MDIPARENT", 1), "&Save File"
              CASE %MDIPARENT_MENUCLOSE
                   MDIPARENT_MenuEvents CID&, CMsg&, CVal&, Cancel&, EZ_GetMenu("MDIPARENT", 1), "&Close File"
              CASE %MDIPARENT_SEPARATOR_9025
              CASE %MDIPARENT_MENUPSETUP
                   MDIPARENT_MenuEvents CID&, CMsg&, CVal&, Cancel&, EZ_GetMenu("MDIPARENT", 1), "Printer S&etup"
              CASE %MDIPARENT_MENUPRINT
                   MDIPARENT_MenuEvents CID&, CMsg&, CVal&, Cancel&, EZ_GetMenu("MDIPARENT", 1), "&Print"
              CASE %MDIPARENT_MENUPPREVIEW
                   MDIPARENT_MenuEvents CID&, CMsg&, CVal&, Cancel&, EZ_GetMenu("MDIPARENT", 1), "Print Previe&w"
              CASE %MDIPARENT_SEPARATOR_9045
              CASE %MDIPARENT_MENUEXIT
                   MDIPARENT_MenuEvents CID&, CMsg&, CVal&, Cancel&, EZ_GetMenu("MDIPARENT", 1), "E&xit"
              CASE %MDIPARENT_MENUEDIT
                   MDIPARENT_MenuEvents CID&, CMsg&, CVal&, Cancel&, EZ_GetMenu("MDIPARENT", 0), "&Edit"
              CASE %MDIPARENT_MENUCOPY
                   MDIPARENT_MenuEvents CID&, CMsg&, CVal&, Cancel&, EZ_GetMenu("MDIPARENT", 2), "&Copy"
              CASE %MDIPARENT_MENUCUT
                   MDIPARENT_MenuEvents CID&, CMsg&, CVal&, Cancel&, EZ_GetMenu("MDIPARENT", 2), "Cu&t"
              CASE %MDIPARENT_MENUPASTE
                   MDIPARENT_MenuEvents CID&, CMsg&, CVal&, Cancel&, EZ_GetMenu("MDIPARENT", 2), "&Paste"
              CASE %MDIPARENT_MENUWIN
                   MDIPARENT_MenuEvents CID&, CMsg&, CVal&, Cancel&, EZ_GetMenu("MDIPARENT", 0), "&Windows"
              CASE %MDIPARENT_MENUTILE
                   MDIPARENT_MenuEvents CID&, CMsg&, CVal&, Cancel&, EZ_GetMenu("MDIPARENT", 3), "&Tile Windows"
              CASE  %MDIPARENT_REBAR1
                   MDIPARENT_REBAR1_Events CID&, CMsg&, CVal&, Cancel&
              CASE ELSE
                   MDIPARENT_Events CID&, CMsg&, CVal&, Cancel&
         END SELECT
    END SUB
    ' ======================================
    ' [USER ACCESSABLE CODE]  You may Edit !
    ' ======================================
    '<<SAVE>>
    SUB ResizeRebar()
         LOCAL C!, R!, W!, H!, AC!, AR!, AW!, AH!
         EZ_GetSize "MDIParent", AW!, AH!, 0
         EZ_GetSizeC "MDIParent",%MDIPARENT_REBAR1, C!, R!, W!, H!
         EZ_ResizeC  "MDIParent",%MDIPARENT_REBAR1, C!, R!, AW!, H!
    END SUB
    SUB ResizeMDIClient()
         LOCAL C!, R!, W!, H!, AC!, AR!, AW!, AH!
         EZ_GetSize "MDIParent", AW!, AH!, 0
         EZ_GetSizeC "MDIParent",%MDIPARENT_REBAR1, C!, R!, W!, H!
         AC!=0
         AR!=H!
         AH!=AH!-H!
         EZ_GetSizeC "MDIParent",%MDIPARENT_STATUSBAR, C!, R!, W!, H!
         AH!=AH!-H!
         EZ_ResizeMDI "MDIParent", AC!, AR!, AW!, AH!, 0
    END SUB
    '<<END>>
    SUB MDIPARENT_Events(CID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CID&
              CASE %EZ_Window
                   SELECT CASE CMsg&
                        CASE %EZ_Loading
                        CASE %EZ_Loaded
                             EZ_SetFormIcon "MDIParent",EZ_LoadIcon("%EZEZ")
                             EZ_TBAR1_Display "MDIParent", %MDIPARENT_REBAR1, "", 0,-1, "","|E?>"
                             EZ_TBAR2_Display "MDIParent", %MDIPARENT_REBAR1, "", 0,-1, "","|E?>"
                             ResizeMDIClient
                             DIM FW!, FH!
                             EZ_GetSize "MDIParent", FW!, FH!,0
                             EZ_SetFormMinMax "MDIParent", FW!, FH!, 999,999
                        CASE %EZ_Started
                             EZ_MDIchild_Display "MDIParent", 0,0
                             EZ_MaximizeForm "MDIChild"
                        CASE %EZ_Size
                             ResizeRebar    ' resize rebar and then let Windows handle  this first
                             ' Rebar will get %EZ_Size event (subclassed) and there MDIClient will be resized
                        CASE %EZ_DoMDIMsg
                             IF EZ_IsForm(EZ_GetFocusForm, "MDI")=0 THEN Cancel&=1
                        CASE %EZ_Close
                        CASE ELSE
                   END SELECT
              CASE ELSE
         END SELECT
    END SUB
     
    SUB MDIPARENT_REBAR1_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
              CASE %EZ_Size
                   ResizeMDIClient    ' now resize MDIclient after windows done with rebar
              CASE ELSE
         END SELECT
    END SUB
     
    '<<BEGINFORM>> "MDICHILD"
     
    ' ======================================
    ' [PROTECTED CODE]         Do NOT Edit !
    ' ======================================
    SUB EZ_MDICHILD_Display(BYVAL Parent$, BYVAL AC!, BYVAL AR!)     ' (PROTECTED)
         EZ_Color -1, -1
         EZ_Form "MDICHILD", Parent$, "newtext.txt", AC!, AR!, 44, 17, "^_Z{MDI-C}"
    END SUB
    SUB EZ_MDICHILD_Design()     ' (PROTECTED)
         LOCAL CText$
         EZ_Color-1,-1
         EZ_UseFont 4
         EZ_SubClass 2
         EZ_RichText1 %MDICHILD_TEXT1, 0, 0, 44, 17, "]BESTV"
         EZ_SubClass 0
         MDICHILD_TEXT1_Load -1,  ""
         ' -----------------------------------------------
    END SUB
     
    SUB EZ_MDICHILD_ParseEvents(CID&, CMsg&, CVal&, Cancel&)     ' (PROTECTED)
         SELECT CASE CID&
              CASE %EZ_Window
                   MDICHILD_Events CID&, CMsg&, CVal&, Cancel&
              CASE  %MDICHILD_TEXT1
                   MDICHILD_TEXT1_Events CID&, CMsg&, CVal&, Cancel&
                   IF CMsg&=%EZ_EditSetSel THEN
                        MDICHILD_TEXT1_EditSetSel CVal&
                   END IF
                   IF CMsg&=%EZ_SubClass THEN
                        MDICHILD_TEXT1_SubClass CVal&, Cancel&
                   END IF
              CASE ELSE
                   MDICHILD_Events CID&, CMsg&, CVal&, Cancel&
         END SELECT
    END SUB
    ' ======================================
    ' [USER ACCESSABLE CODE]  You may Edit !
    ' ======================================
    '<<SAVE>>
    SUB ResizeTextBox(BYVAL FormName$, BYVAL ID&)
         LOCAL W!, H!
         EZ_GetSize FormName$, W!, H!, 0
         EZ_ResizeC FormName$, ID&,0,0, W!, H!
    END SUB
    '<<END>>
    SUB MDICHILD_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 %EZ_Size
                             ResizeTextBox "MDIChild", %MDICHILD_TEXT1
                        CASE ELSE
                   END SELECT
              CASE ELSE
         END SELECT
    END SUB
     
    SUB MDICHILD_EditSetSel(BYVAL CVal&)
         LOCAL SMin&, SMax&
         EZ_GetSelVal CVal&, SMin&, SMax&
         ' modify SMin& and SMax& values here
         SMax&=SMin&
         EZ_SetSelVal CVal&, SMin&, SMax&
    END SUB
     
    SUB MDICHILD_TEXT1_Load(BYVAL Mode&, BYVAL D$)
         EZ_SetRichText "MDIchild", %MDICHILD_TEXT1, D$, 0, 0
    END SUB
     
    SUB MDICHILD_TEXT1_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Change
              CASE %EZ_Focus
                   EZ_SetDlgMsgMode 0       ' allows RichEdit to use Tab key
              CASE %EZ_NoFocus
                   EZ_SetDlgMsgMode 1       ' returns normal use of keys
              CASE %EZ_Loaded
                   DefFirstFont
              CASE ELSE
         END SELECT
    END SUB
     
    SUB MDICHILD_TEXT1_EditSetSel(BYVAL CVal&)
         MDIchild_EditSetSel CVal&
    END SUB
     
    SUB MDICHILD_TEXT1_SubClass(BYVAL CVal&, Cancel&)
         LOCAL hCtrl&, Msg&, wParam&, lParam&
         EZ_GetSubClass  CVal&, hCtrl&, Msg&, wParam&, lParam&
         IF EZ_IsMsg(Msg&,"KB") THEN
              ' update the font toolbar
              UpdateFontBar
              UpdateAlignmentBar
         END IF
    END SUB
     
    '<<BEGINFORM>> "PPFORM"
     
    ' ======================================
    ' [PROTECTED CODE]         Do NOT Edit !
    ' ======================================
    SUB EZ_PPFORM_Display(BYVAL Parent$)     ' (PROTECTED)
         EZ_Color 0, 32
         EZ_AllowLoadingEvent 2
         EZ_Form "PPFORM", Parent$, "Print Preview", 0, 0, 48.25, 29, "^CMRZ"
    END SUB
    SUB EZ_PPFORM_Design()     ' (PROTECTED)
         LOCAL CText$
         EZ_Color 35, 34
         EZ_UseFont 4
         EZ_ODButton %PPFORM_NEXTPAGE, 13.5, .125, 10.75, 1.625, "Next Page", "AT"
         EZ_SetRegion "PPForm", %PPFORM_NEXTPAGE,-2,0
         ' -----------------------------------------------
         EZ_Color 35, 34
         EZ_UseFont 4
         EZ_ODButton %PPFORM_PREVPAGE, .75, .125, 10.75, 1.625, "Previous Page", "AT"
         EZ_SetRegion "PPForm", %PPFORM_PREVPAGE,-2,0
         ' -----------------------------------------------
         EZ_Color 35, 34
         EZ_UseFont 4
         EZ_ODButton %PPFORM_PRINTPAGE, 26.375, .125, 9.5, 1.625, "Print", "AT"
         EZ_SetRegion "PPForm", %PPFORM_PRINTPAGE,-2,0
         ' -----------------------------------------------
         EZ_Color 35, 34
         EZ_UseFont 4
         EZ_ODButton %PPFORM_CLOSEPREVIEW, 38, .125, 9.5, 1.625, "Close", "AT"
         EZ_SetRegion "PPForm", %PPFORM_CLOSEPREVIEW,-2,0
         ' -----------------------------------------------
         EZ_Color 0, 33
         EZ_UseFont 4
         EZ_Label %PPFORM_LABEL1, 0, 0, 48.25, 2, "[[34,32,6]]", "CO"
         ' -----------------------------------------------
         EZ_Color 0, 15
         EZ_UseFont 4
         EZ_Canvas %PPFORM_CANVAS1, 4, 2.5, 40.25, 26, "F"
         PPFORM_CANVAS1_Draw -1
         ' -----------------------------------------------
    END SUB
     
    SUB EZ_PPFORM_ParseEvents(CID&, CMsg&, CVal&, Cancel&)     ' (PROTECTED)
         SELECT CASE CID&
              CASE %EZ_Window
                   PPFORM_Events CID&, CMsg&, CVal&, Cancel&
              CASE  %PPFORM_NEXTPAGE
                   PPFORM_NEXTPAGE_Events CID&, CMsg&, CVal&, Cancel&
                   IF CMsg&=%EZ_OwnerDraw THEN
                        EZ_Draw3DButtonRR "PPForm", %PPFORM_NEXTPAGE, CVal&, 34, 35,  4
                   END IF
              CASE  %PPFORM_PREVPAGE
                   PPFORM_PREVPAGE_Events CID&, CMsg&, CVal&, Cancel&
                   IF CMsg&=%EZ_OwnerDraw THEN
                        EZ_Draw3DButtonRR "PPForm", %PPFORM_PREVPAGE, CVal&, 34, 35,  4
                   END IF
              CASE  %PPFORM_PRINTPAGE
                   PPFORM_PRINTPAGE_Events CID&, CMsg&, CVal&, Cancel&
                   IF CMsg&=%EZ_OwnerDraw THEN
                        EZ_Draw3DButtonRR "PPForm", %PPFORM_PRINTPAGE, CVal&, 34, 35,  4
                   END IF
              CASE  %PPFORM_CLOSEPREVIEW
                   PPFORM_CLOSEPREVIEW_Events CID&, CMsg&, CVal&, Cancel&
                   IF CMsg&=%EZ_OwnerDraw THEN
                        EZ_Draw3DButtonRR "PPForm", %PPFORM_CLOSEPREVIEW, CVal&, 34, 35,  4
                   END IF
              CASE  %PPFORM_LABEL1
                   IF CMsg&=%EZ_OwnerDraw THEN
                        EZ_DrawLabel CVal&, 0,  33,  "[[34,32,6]]"
                   END IF
              CASE ELSE
                   PPFORM_Events CID&, CMsg&, CVal&, Cancel&
         END SELECT
    END SUB
    ' ======================================
    ' [USER ACCESSABLE CODE]  You may Edit !
    ' ======================================
    '<<SAVE>>
    SUB InitSizePreview()
         LOCAL X!, Y!, W!, H!, TW!
         EZ_GetArea "", 0, X!, Y!, W!, H!, "DW",0,0   ' get desktop work area
         H!=H!-EZ_CY(EZ_WO("FC|3Y|3Y"))-1
         W!=W!-EZ_CX(EZ_WO("3X|3X"))-2
         TW!=(48.25/29)*H!
         IF TW!<W! THEN W!=TW!
         EZ_SetLoadVal "W", W!
         EZ_SetLoadVal "H", H!
    END SUB
    SUB SetPPMinMax()
         LOCAL FW!, FH!
         EZ_GetSize "PPForm", FW!, FH!, 0
         EZ_SetFormMinMax "PPForm", FW!, FH!, 999,999
    END SUB
    SUB ResizePPControls()
         LOCAL C!, R!, W!, H!, FW!, FH!
         EZ_GetSize "PPForm", FW!, FH!, 0
         EZ_GetSizeC "PPForm", %PPFORM_LABEL1, C!, R!, W!, H!
         EZ_ResizeC "PPForm", %PPFORM_LABEL1, C!, R!, FW!, H!
         EZ_GetSizeC "PPForm", %PPFORM_CANVAS1, C!, R!, W!, H!
         H!=FH!-R!-1
         W!=(8.5/11)*H!*2
         C!=(FW!-W!)/2
         EZ_ResizeC "PPForm", %PPFORM_CANVAS1, C!, R!, W!, H!
         EZ_PostEvent "PPForm",0, 1
    END SUB
    SUB DisplayCurrentPage()
         PrintRTF "PPForm", "MDIChild", %MDICHILD_TEXT1, "PPForm", %PPFORM_CANVAS1, App_CurrentPage&, App_PageCount&
         IF App_CurrentPage& < App_PageCount& THEN
              EZ_EnableC "PPForm", %PPFORM_NEXTPAGE
         ELSE
              EZ_DisableC "PPForm", %PPFORM_NEXTPAGE
         END IF
    END SUB
    '<<END>>
    SUB PPFORM_Events(CID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CID&
              CASE %EZ_Window
                   SELECT CASE CMsg&
                        CASE %EZ_Post
                             IF CVal&=1 THEN DisplayCurrentPage
                        CASE %EZ_Loading
                             InitSizePreview
                        CASE %EZ_Loaded
                             SetPPMinMax
                        CASE %EZ_Started
                             ResizePPControls
                        CASE %EZ_Size
                             ResizePPControls
                        CASE %EZ_Close
                        CASE ELSE
                   END SELECT
              CASE ELSE
         END SELECT
    END SUB
    '<<SAVE>>
    SUB DoAnotherPage(BYVAL Mode&)
         SELECT CASE Mode&
              CASE 1
                   IF App_CurrentPage& < App_PageCount& THEN
                        App_CurrentPage&=App_CurrentPage&+1
                   ELSE
                        EXIT SUB
                   END IF
              CASE -1
                   IF App_CurrentPage& > 1 THEN
                        App_CurrentPage&=App_CurrentPage&-1
                   ELSE
                        EXIT SUB
                   END IF
              CASE ELSE
                   EXIT SUB
         END SELECT
         PrintRTF "PPForm", "MDIChild", %MDICHILD_TEXT1, "PPForm", %PPFORM_CANVAS1, App_CurrentPage&, App_PageCount&
         IF App_CurrentPage& < App_PageCount& THEN
              EZ_EnableC "PPForm", %PPFORM_NEXTPAGE
         ELSE
              EZ_DisableC "PPForm", %PPFORM_NEXTPAGE
         END IF
    END SUB
    '<<END>>
    SUB PPFORM_NEXTPAGE_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click, %EZ_DClick
                   DoAnotherPage 1
              CASE %EZ_OwnerDraw
              CASE %EZ_Click
              CASE ELSE
         END SELECT
    END SUB
    SUB PPFORM_PREVPAGE_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click, %EZ_DClick
                   DoAnotherPage -1
              CASE %EZ_OwnerDraw
              CASE %EZ_Click
              CASE ELSE
         END SELECT
    END SUB
    SUB PPFORM_PRINTPAGE_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
                   DIM PageCount&
                   PrintRTF "PPForm", "MDIChild", %MDICHILD_TEXT1, "", 0, 0, PageCount&
              CASE %EZ_OwnerDraw
              CASE ELSE
         END SELECT
    END SUB
    SUB PPFORM_CLOSEPREVIEW_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
                   EZ_UnloadForm "PPForm"
              CASE %EZ_OwnerDraw
              CASE ELSE
         END SELECT
    END SUB
     
    SUB PPFORM_CANVAS1_Draw(BYVAL Mode&)
    END SUB
     
    '<<BEGINFORM>> "TBAR1"
     
    ' ======================================
    ' [PROTECTED CODE]         Do NOT Edit !
    ' ======================================
    SUB EZ_TBAR1_Display(BYVAL FormName$, BYVAL RebarID&, BYVAL BText$, BYVAL ImgIndex&, BYVAL HWidth&, BYVAL BGPict$, BYVAL BProp$)     ' (PROTECTED)
         EZ_Color -1, -1
         EZ_AddRBForm FormName$, RebarID&, 28, 2,"TBAR1", BText$, ImgIndex&, HWidth&, BGPict$, BProp$
    END SUB
    SUB EZ_TBAR1_Design()     ' (PROTECTED)
         LOCAL CText$
         EZ_Color-1,-1
         EZ_UseFont 4
         STATIC PN1$
         IF PN1$ = "" THEN PN1$ = EZ_LoadPicture("%EZMTOOLBAR{S}")
         EZ_Toolbar %TBAR1_TOOLBAR1, PN1$,  "BBBB B|F124M", "!FNOT24X24"
         ' -----------------------------------------------
    END SUB
     
    SUB EZ_TBAR1_ParseEvents(CID&, CMsg&, CVal&, Cancel&)     ' (PROTECTED)
         SELECT CASE CID&
              CASE %EZ_Window
                   TBAR1_Events CID&, CMsg&, CVal&, Cancel&
              CASE  %TBAR1_TOOLBAR1
                   TBAR1_TOOLBAR1_Events CID&, CID&, 0, CMsg&, CVal&, Cancel&      ' Main Toobar ID
              CASE  %TBAR1_TOOLBAR1+1 TO  %TBAR1_TOOLBAR1+5
                   LOCAL TBNum&
                   TBNum& = CID&- %TBAR1_TOOLBAR1
                   TBAR1_TOOLBAR1_Events  %TBAR1_TOOLBAR1, CID&, TBNum&, CMsg&, CVal&, Cancel&
              CASE ELSE
                   TBAR1_Events CID&, CMsg&, CVal&, Cancel&
         END SELECT
    END SUB
    ' ======================================
    ' [USER ACCESSABLE CODE]  You may Edit !
    ' ======================================
    SUB TBAR1_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
     
    SUB TBAR1_TOOLBAR1_Events( BYVAL TBarID&, MyID&, BYVAL ButtonN&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
                   SELECT CASE ButtonN&
                        CASE 1 TO 4
                             DoTextFile ButtonN&-1
                        CASE 5
                             DoPrint 1
                   END SELECT
              CASE %EZ_ToolTip
                   SELECT CASE ButtonN&
                        CASE 1
                             EZ_SetToolTip "New File"
                        CASE 2
                             EZ_SetToolTip "Open File"
                        CASE 3
                             EZ_SetToolTip "Save File"
                        CASE 4
                             EZ_SetToolTip "Close File"
                        CASE 5
                             EZ_SetToolTip "Print"
                   END SELECT
              CASE ELSE
         END SELECT
    END SUB
     
    '<<BEGINFORM>> "TBAR2"
     
    ' ======================================
    ' [PROTECTED CODE]         Do NOT Edit !
    ' ======================================
    SUB EZ_TBAR2_Display(BYVAL FormName$, BYVAL RebarID&, BYVAL BText$, BYVAL ImgIndex&, BYVAL HWidth&, BYVAL BGPict$, BYVAL BProp$)     ' (PROTECTED)
         EZ_Color -1, -1
         EZ_AddRBForm FormName$, RebarID&, 81, 2.5,"TBAR2", BText$, ImgIndex&, HWidth&, BGPict$, BProp$ + "K"
    END SUB
    SUB EZ_TBAR2_Design()     ' (PROTECTED)
         LOCAL CText$
         EZ_Color 35, 34
         EZ_UseFont 0
         EZ_ODButton %TBAR2_BOLDBUTTON, .5, .25, 4, 2, "B", "T"
         EZ_SetRegion "TBAR2", %TBAR2_BOLDBUTTON,-2,0
         EZ_AddToolTip "TBAR2", %TBAR2_BOLDBUTTON
         ' -----------------------------------------------
         EZ_Color 35, 34
         EZ_UseFont 0
         EZ_ODButton %TBAR2_ITALICBUTTON, 4.5, .25, 4, 2, "I", "T"
         EZ_SetRegion "TBAR2", %TBAR2_ITALICBUTTON,-2,0
         EZ_AddToolTip "TBAR2", %TBAR2_ITALICBUTTON
         ' -----------------------------------------------
         EZ_Color 35, 34
         EZ_UseFont 0
         EZ_ODButton %TBAR2_UNDERBUTTON, 8.5, .25, 4, 2, "U", "T"
         EZ_SetRegion "TBAR2", %TBAR2_UNDERBUTTON,-2,0
         EZ_AddToolTip "TBAR2", %TBAR2_UNDERBUTTON
         ' -----------------------------------------------
         EZ_Color-1,-1
         EZ_UseFont 4
         EZ_AllowLoadingEvent 2
         EZ_ComboBox %TBAR2_FONTNAMES, 13.5, .625, 27.625, 15.875, "Custom Font", "$?AJOTV"
         EZ_SelectItem "TBAR2", %TBAR2_FONTNAMES, 0
         ' -----------------------------------------------
         EZ_Color-1,-1
         EZ_UseFont 4
         EZ_AllowLoadingEvent 2
         EZ_ComboBox %TBAR2_FONTSIZES, 41.75, .625, 7.625, 18.5625, "8|9|10|11|12|", "JTV"
         EZ_SelectItem "TBAR2", %TBAR2_FONTSIZES, 0
         ' -----------------------------------------------
         EZ_Color-1,-1
         EZ_UseFont 4
         EZ_AllowLoadingEvent 2
         EZ_ComboBox %TBAR2_FONTCOLORS, 50.125, .625, 17.125, 15.875, "Item 1|Item 2|Item 3|Item 4|Item 5|", "$JOTV"
         EZ_SelectItem "TBAR2", %TBAR2_FONTCOLORS, 0
         ' -----------------------------------------------
         EZ_Color 35, 34
         EZ_UseFont 0
         EZ_ODButton %TBAR2_LEFTBUTTON, 68.25, .25, 4, 2, "L", "T"
         EZ_SetRegion "TBAR2", %TBAR2_LEFTBUTTON,-2,0
         EZ_AddToolTip "TBAR2", %TBAR2_LEFTBUTTON
         ' -----------------------------------------------
         EZ_Color 35, 34
         EZ_UseFont 0
         EZ_ODButton %TBAR2_CENTERBUTTON, 72.25, .25, 4, 2, "C", "T"
         EZ_SetRegion "TBAR2", %TBAR2_CENTERBUTTON,-2,0
         EZ_AddToolTip "TBAR2", %TBAR2_CENTERBUTTON
         ' -----------------------------------------------
         EZ_Color 35, 34
         EZ_UseFont 0
         EZ_ODButton %TBAR2_RIGHTBUTTON, 76.25, .25, 4, 2, "R", "T"
         EZ_SetRegion "TBAR2", %TBAR2_RIGHTBUTTON,-2,0
         EZ_AddToolTip "TBAR2", %TBAR2_RIGHTBUTTON
         ' -----------------------------------------------
    END SUB
     
    SUB EZ_TBAR2_ParseEvents(CID&, CMsg&, CVal&, Cancel&)     ' (PROTECTED)
         SELECT CASE CID&
              CASE %EZ_Window
                   TBAR2_Events CID&, CMsg&, CVal&, Cancel&
              CASE  %TBAR2_BOLDBUTTON
                   IF CMsg& = %EZ_ToolTip THEN EZ_SetToolTip "Bold Face"
                   TBAR2_BOLDBUTTON_Events CID&, CMsg&, CVal&, Cancel&
              CASE  %TBAR2_ITALICBUTTON
                   IF CMsg& = %EZ_ToolTip THEN EZ_SetToolTip "Italic"
                   TBAR2_ITALICBUTTON_Events CID&, CMsg&, CVal&, Cancel&
              CASE  %TBAR2_UNDERBUTTON
                   IF CMsg& = %EZ_ToolTip THEN EZ_SetToolTip "Underlined"
                   TBAR2_UNDERBUTTON_Events CID&, CMsg&, CVal&, Cancel&
              CASE  %TBAR2_FONTNAMES
                   TBAR2_FONTNAMES_Events CID&, CMsg&, CVal&, Cancel&
              CASE  %TBAR2_FONTSIZES
                   TBAR2_FONTSIZES_Events CID&, CMsg&, CVal&, Cancel&
              CASE  %TBAR2_FONTCOLORS
                   TBAR2_FONTCOLORS_Events CID&, CMsg&, CVal&, Cancel&
              CASE  %TBAR2_LEFTBUTTON
                   IF CMsg& = %EZ_ToolTip THEN EZ_SetToolTip "Left Aligned"
                   TBAR2_LEFTBUTTON_Events CID&, CMsg&, CVal&, Cancel&
              CASE  %TBAR2_CENTERBUTTON
                   IF CMsg& = %EZ_ToolTip THEN EZ_SetToolTip "Center"
                   TBAR2_CENTERBUTTON_Events CID&, CMsg&, CVal&, Cancel&
              CASE  %TBAR2_RIGHTBUTTON
                   IF CMsg& = %EZ_ToolTip THEN EZ_SetToolTip "Right Aligned"
                   TBAR2_RIGHTBUTTON_Events CID&, CMsg&, CVal&, Cancel&
              CASE ELSE
                   TBAR2_Events CID&, CMsg&, CVal&, Cancel&
         END SELECT
    END SUB
    ' ======================================
    ' [USER ACCESSABLE CODE]  You may Edit !
    ' ======================================
    SUB TBAR2_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
     
    SUB TBAR2_BOLDBUTTON_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
                   ChangeFontEffect 1, CVal&
              CASE %EZ_OwnerDraw
                   IF App_BoldState& THEN
                        EZ_Draw3DButtonRR "TBAR2", MyID&, CVal&, 46, 47,  0
                   ELSE
                        EZ_Draw3DButtonRR "TBAR2", MyID&, CVal&, 34, 35,  0
                   END IF
              CASE ELSE
         END SELECT
    END SUB
     
    SUB TBAR2_ITALICBUTTON_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
                   ChangeFontEffect 2, CVal&
              CASE %EZ_OwnerDraw
                   IF App_ItalicState& THEN
                        EZ_Draw3DButtonRR "TBAR2", MyID&, CVal&, 46, 47,  0
                   ELSE
                        EZ_Draw3DButtonRR "TBAR2", MyID&, CVal&, 34, 35,  0
                   END IF
              CASE ELSE
         END SELECT
    END SUB
     
    SUB TBAR2_UNDERBUTTON_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
                   ChangeFontEffect 3, CVal&
              CASE %EZ_OwnerDraw
                   IF App_UnderState& THEN
                        EZ_Draw3DButtonRR "TBAR2", MyID&, CVal&, 46, 47,  0
                   ELSE
                        EZ_Draw3DButtonRR "TBAR2", MyID&, CVal&, 34, 35,  0
                   END IF
              CASE ELSE
         END SELECT
    END SUB
    '<<SAVE>>
    SUB FillFontList()
         LOCAL F$, N&, T$
         F$=EZ_GetFont(1,"", "")+"<R>ABC   "
         N&=2
         DO
              T$=EZ_GetFont(N&,"","")
              IF T$="" THEN EXIT DO
              F$=F$+"|"+T$+"<R>ABC   "
              N&=N&+1
         LOOP
         EZ_SetLoadStr "T", F$
    END SUB
    SUB FillFontSize()
         LOCAL N&, T$
         FOR N&=1 TO 127
              IF N&>1 THEN T$=T$+"|"
              T$=T$+RIGHT$("   "+STR$(N&),3)
         NEXT N&
         EZ_SetLoadStr "T", T$
    END SUB
    SUB FillFontColors()
         LOCAL N&, T$, C&
         EZ_SaveState
         FOR N&=0 TO 15
              IF N&>0 THEN T$=T$+"|"
              EZ_Color N&, N&
              C&=EZ_ColorVal(N&,0)
              T$=T$+"<&H"+HEX$(C&,8)+">"
              IF N&=0 THEN T$=T$+"  Black"
              IF N&=1 THEN T$=T$+"  Dk. Blue"
              IF N&=2 THEN T$=T$+"  Dk. Green"
              IF N&=3 THEN T$=T$+"  Dk. Cyan"
              IF N&=4 THEN T$=T$+"  Dk. Red"
              IF N&=5 THEN T$=T$+"  Dk. Purple"
              IF N&=6 THEN T$=T$+"  Brown"
              IF N&=7 THEN T$=T$+"  Lt. Gray"
              IF N&=8 THEN T$=T$+"  Gray"
              IF N&=9 THEN T$=T$+"  Blue"
              IF N&=10 THEN T$=T$+"  Green"
              IF N&=11 THEN T$=T$+"  Cyan"
              IF N&=12 THEN T$=T$+"  Red"
              IF N&=13 THEN T$=T$+"  Purple"
              IF N&=14 THEN T$=T$+"  Yellow"
              IF N&=15 THEN T$=T$+"  White"
         NEXT N&
         C&=EZ_ColorVal(99,0)
         T$=T$+"|<&H"+HEX$(C&,8)+">   AutoColor"
         T$=T$+"|<&H"+HEX$(RGB(255,128,0),8)+">   Custom"
         EZ_RestoreState
         EZ_SetLoadStr "T", T$
    END SUB
    '<<END>>
    SUB TBAR2_FONTNAMES_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Change
                   ChangeFontEffect 4, CVal&
              CASE %EZ_OwnerSize
                   EZ_SizeComboBox CVal&, 4
              CASE %EZ_OwnerDraw
                   EZ_DrawComboBox "TBAR2", MyID&, CVal&, 4, 0, "F"
              CASE %EZ_Loading
                   FillFontList
                   EZ_SubClass 2
              CASE %EZ_Loaded
                   EZ_SubClass 0
              CASE %EZ_EraseBG
                   Cancel&=1
              CASE ELSE
         END SELECT
    END SUB
     
    SUB TBAR2_FONTSIZES_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Change
                   ChangeFontEffect 5, CVal&
              CASE %EZ_Loading
                   FillFontSize
              CASE ELSE
         END SELECT
    END SUB
     
    SUB TBAR2_FONTCOLORS_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Change
                   ChangeFontEffect 6, CVal&
              CASE %EZ_OwnerDraw
                   EZ_DrawComboBox "TBAR2", MyID&, CVal&, 4, 0, "C"
              CASE %EZ_OwnerSize
                   EZ_SizeComboBox CVal&, 4
              CASE %EZ_Loading
                   FillFontColors
                   EZ_SubClass 2
              CASE %EZ_Loaded
                   EZ_SubClass 0
              CASE %EZ_EraseBG
                   Cancel&=1
              CASE ELSE
         END SELECT
    END SUB
    SUB TBAR2_LEFTBUTTON_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
                    ChangeParEffect 0
              CASE %EZ_OwnerDraw
                   IF App_LeftAlign& THEN
                        EZ_Draw3DButtonRR "TBAR2", MyID&, CVal&, 46, 47,  0
                   ELSE
                        EZ_Draw3DButtonRR "TBAR2", MyID&, CVal&, 34, 35,  0
                   END IF
              CASE ELSE
         END SELECT
    END SUB
    SUB TBAR2_CENTERBUTTON_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
                    ChangeParEffect 1
              CASE %EZ_OwnerDraw
                   IF App_CenterAlign& THEN
                        EZ_Draw3DButtonRR "TBAR2", MyID&, CVal&, 46, 47,  0
                   ELSE
                        EZ_Draw3DButtonRR "TBAR2", MyID&, CVal&, 34, 35,  0
                   END IF
              CASE ELSE
         END SELECT
    END SUB
    SUB TBAR2_RIGHTBUTTON_Events( MyID&, CMsg&, CVal&, Cancel&)
         SELECT CASE CMsg&
              CASE %EZ_Click
                    ChangeParEffect 2
              CASE %EZ_OwnerDraw
                   IF App_RightAlign& THEN
                        EZ_Draw3DButtonRR "TBAR2", MyID&, CVal&, 46, 47,  0
                   ELSE
                        EZ_Draw3DButtonRR "TBAR2", MyID&, CVal&, 34, 35,  0
                   END IF
              CASE ELSE
         END SELECT
    END SUB
    Attached Files
    Last edited by Chris Boss; 29 Apr 2009, 11:11 PM.
    Chris Boss
    Computer Workshop
    Developer of "EZGUI"
    http://cwsof.com
    http://twitter.com/EZGUIProGuy

    Comment

    Working...
    X