Announcement

Collapse
No announcement yet.

EZGUI discounted for a short time, only $39 for limited time

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

  • EZGUI discounted for a short time, only $39 for limited time

    You can now purchase EZGUI 5.0 Professional for only $39 for a limited time. Act now before the price goes back to the normal $249 price.

    To order, you can go directly to the BMT-Micro order page using this link:

    https://secure.bmtmicro.com/servlets...DUCTID=7270033

    Click here for an overview of the features of EZGUI 5.0 Professional: http://cwsof.com/softdev/ezgui5pro.html

    FAQ:

    What is EZGUI 5.0 Pro ?

    It is the only GUI framework specifically designed for use with Powerbasic. It consists of a runtime framework (DLLs) and its own drag and drop Visual Designer/Code Generator.

    How big is the runtime ?

    The runtime has a primary DLL which is about 700 KB in size. I would say about 90% of the feature set is contained in this one DLL. Most applications can consist of your EXE and this one DLL. There are a number of secondary DLL's which are used for special features, ranging from 22 KB to 88 KB in size. One is a bit larger, which contains the OpenGL Canvas control (for 3D) which is 225 KB in size.

    Does EZGUI do 3D ?

    Yes, it has its own 3D custom control which is OpenGL based, with its own 3D scripting language built in.

    Does EZGUI do 2D drawing and animation ?

    Yes, it has its own 2D Canvas control for drawing, plus it has its own 2D Sprite (animation) engine built in.

    Does EZGUI have more than just the system controls ?

    Yes, it has a number of built in custom controls. Aside from the 3D Canvas and 2D canvas control is has a Property Listbox control, Files Listbox control, Turtle Graphics control (vector based images), Masked Edit control, Shape / Hotspot / Splitterbar control (all in one) and an MCI control (MCI multimedia with built in scripting language).

    Does the Visual Designer have its own code editor built in ?

    No. Instead is allows you to define any compatible external code editor to be used (ie. Jellyfish, PB IDE) and when it generates code it runs your own code editor of choice. By using a Smart Parser technology (literally rewrites your code before running your code editor), it allows you to have an integrated environment where you can move seamlessly between designed and code editor.

    What advanced system controls (ie. common controls) does it support ?

    Listview, Treeview, Toolbar, Statusbar, Progressbar, Pager, Rebar, Tab control, UpDown control, Calendar control, DateTime control, Trackbar control, Animation control, MDI custom control (for Multiple Document Interface) and RichEdit control (supports versions 1.0 to 4.0).

    Does EZGUI have its own print engine ?

    Yes it does and even a hybrid print to Canvas (using same code for Printer and Canvas) for building your own print preview display.

    How big is the EZGUI command set ?

    Nearly 1000 commands, not counting the scripting languages. It is larger than some programming language GUI command sets.

    I heard EZGUI is just a simple wrapper over the WIN32 API, is this true or not ?

    Absolutely not true ! EZGUI is an advanced GUI framework unlike anything else for Powerbasic and it contains a significant amount of proprietary engines in it, such as OpenGL 3D scripting language, 2D sprite engine, advanced graphics, many custom controls, threading engine, layer engine and more. Many commands in EZGUI contain many hundreds of lines of code in them and would not be easy to even come close in emulating yourself using the WIN32 API alone.

    Is EZGUI suited for building commercial software ?

    Absolutely! That is what it was designed for. A number of long time EZGUI users are writing commercial software with it. It has proven itself to be reliable and effective for building quality software.

    I already use DDT (PB Forms) or Firefly. Of what benefit would EZGUI be for me ?

    Rather than view it as a replacement for other development methods, consider it simply just another tool in your toolbox. Continue to use those other methods for the things they work best for, but use EZGUI for the kind of software you would never even consider doing with those tools. For example, if you need OpenGL 3D, then use EZGUI for apps which require that. If you need more complex user interfaces, which you can build in half the time, then consider using EZGUI for that. Use EZGUI for what it was designed for, building complex advanced user interfaces. I guarantee you, that the kind of user interfaces you can build with EZGUI 5.0 pro are simply beyond those other tools, unless you are a very advanced and very experienced WIN32/OpenGL programmer and even then it would likely take you 5 times longer to do it with them.

    What is the one thing you feel most potential users don't understand about EZGUI ?

    Its raw power !!! Yes, I mean that. I didn't design EZGUI just to satisfy customer requests for features, but I designed it for myself first. Yes, I designed into EZGUI powerful features which I felt were key to making it one of the most power (yet tiny) GUI frameworks around with almost unlimited possibilities. Most current EZGUI users only use a small portion of the feature set and if they only knew how much was really there, they would be surprised. Often customers request some "new" feature, only for me to tell them "EZGUI already does that" and when they see how easy it is, they are often very surprised.

    EZGUI has many levels to it, from very high level to very low level. If you can't do something exactly the way you want with the high level commands, then often it can be done with just a little more code using the medium level commands. If that won't accomplish what you want, then very likely, with a little more code, it can be done using EZGUI's low level commands. EZGUI was also designed so one can easily integrate WIN32 API code into it. It even provides "hooks" into some of its low level engines, so you can change its code functionality.

    EZGUI is so powerful (truthfully so) that it is worth every penny of its normal $249 price. But for the low sale price I offer it is an amazing deal. No matter what other tools or method you currently use (DDT, PB Forms, Firefly), EZGUI is definitely worth being part of your programming toolbox.

    I am a hobby programmer, so even the low sale price is a lot for me! Of what benefit would it be for me ?

    If you are a hobby programmer, then definitely at this low price you should consider buying EZGUI. Compare the low price to the normal $249 price. You definitely would not buy it for $249, but now it is affordable and worth getting. Why ? Because often many a "hobby" programmer eventually turns out to become a professional programmer. Some hobby programmers, with the right tools, can build apps which they sell themselves online. Whether shareware style or simply "pay first", such apps written by hobby programmers, if done well, can be become "hits" in their own market. EZGUI's feature set is so advanced that some hobby programmers find themselves building apps with it they thought never possible for them.

    I learned programming back in the 1980's when many were hobby programmers. I eventually found myself writing custom software for a number of local businesses and never envisioned I would become an advanced Windows programmer someday. Do not underestimate what you can accomplish with the right tools. Not every hobby programmer can reach a professional level, but you would be surprised how many of todays professional programmers started it as a hobby.

    Do I get tech support at this low price ?

    Absolutely. I provide some of the best tech support around. You can email me questions or register on my forums for online support. I regularly check my forums and often post answers for most questions within a few hours after the post. My forums are not Peer to Peer like the PB forums. They are a true tech support forum and I try to answer most questions myself. Also other forum users often will add to the answers, so you get plenty of feedback.

    My online forums: http://cwsof.com/forums/index.php
    Last edited by Chris Boss; 26 Oct 2017, 12:32 PM.
    Chris Boss
    Computer Workshop
    Developer of "EZGUI"
    http://cwsof.com
    http://twitter.com/EZGUIProGuy

  • #2
    ---------------------------------------
    Last edited by Chris Boss; 10 Nov 2017, 09:08 PM.
    Chris Boss
    Computer Workshop
    Developer of "EZGUI"
    http://cwsof.com
    http://twitter.com/EZGUIProGuy

    Comment


    • #3
      FAQ:

      What are some of the key benefits of EZGUI 5.0 Pro ?

      First, I would say ease of use. Even if you were to use another development tool which provides ease of use in the design stage (visual designer), what really matters is when you have to code. Visual Designers don't solve the coding problem, of the terseness of the Windows API. A few API wrappers may be helpful, but when it comes to the more complex tasks, coding using the Windows API is simply put, a pain. Sure you can look up each API in the SDK docs, but what the SDK does not do is teach you how to combine multiple API calls together to accomplish more complex tasks.

      EZGUI has a huge library of commands to handle likely almost everything you possibly can image you would need to do in an app. Where things are more complex, EZGUI provides a set of commands which work together to make the task easier to do. One good example is ownerdraw. EZGUI makes it far easier than it would be with the Windows API, that is for sure.

      Second, it provides an engine to handle a significant portion of common tasks, so you can concentrate on the important things. For example, scrollbars don't require a lot of code to simply make them work and increment the scrollbar. EZGUI does all that under the hood. You simply get an event when the scrollbar changes and you get passed the current scrollbar position. Trackbar controls do the same. So does the updown control. EZGUI handles most of the mundane stuff so you can concentrate on the real code which makes your app do something unique.

      Third, EZGUI provides many very high level features, which I doubt the average PB programmer would even know where to start or how to do. For example, EZGUI has a built in drag and drop engine for building apps like a Visual Designer. EZGUI provides a powerful engine which does all the hard stuff for you. EZGUI provides a 3D custom control with an easy to use 3D scripting language. It handles all the hard stuff in doing OpenGL, so you can create 3D apps you never thought possible before and no OpenGL knowledge required. You won't be getting that in any other visual designer/code generator tool for Powerbasic.

      Why does EZGUI use DLL's rather than a Static Library (SLL) ?

      Simply put, there are some things a DLL can do which an SLL can not. Second, DLL's provide reusable libraries which decrease the overall size of your application when using multiple EXE's. If you use one EXE, then you don't fully benefit from this, but if your app is made up of multiple EXE's, then by sharing a common runtime in DLL form the overall size of the app is significantly smaller. Classic Visual Basic programmers have been using shared libraries in DLL form for many years with no problem.

      Now some may complain saying "I write small single EXE apps and don't want a DLL". My answer is, EZGUI was not developed for you. EZGUI was designed for those who write large commercial apps, which often require many EXE's and which have complex user interfaces. If your needs are simple then the built in DDT command set in Powerbasic should suffice for you.

      Do you really believe EZGUI pro is worth even the original $249 price ?

      Absolutely. I was programming back in the old Classic Visual Basic days and I remember getting a catalog in the mail which catered to VB'ers with all sorts of third party tools, from programming tools to custom controls. Most of the third party addons were a few hundred dollars and some close to $1000. If there was something like EZGUI back then it would likely have been close to $1000 and for its feature set it would have been very cost effective.

      For a hobby programmer that kind of money seems outrageous, but in the professional programming world it was cheap. If a programming tool saved you significant time in development, then even at $1000 it was worth the cost.

      Last edited by Chris Boss; 7 Nov 2017, 03:16 PM.
      Chris Boss
      Computer Workshop
      Developer of "EZGUI"
      http://cwsof.com
      http://twitter.com/EZGUIProGuy

      Comment


      • #4
        Just another comment about tech support:

        Tech support forums for many products tend to provide minimal response from the developer of a product. Unlike many other tech support forums, the EZGUI forums abound with replies directly from its developer (me). rather than short, terse answers in generalities, I try to provide clear and extensive answers to questions, often providing background info to help better understand things.

        Just check out the main discussion board on my forums with questions about EZGUI here:

        http://cwsof.com/forums/index.php?board=4.0

        Select a number of topics and notice the answers provided by tech support (me) rather than simply other EZGUI users. I try to explain things in detail, at times posting long extensive posts, when needed. I try to post insights to how EZGUI works under the hood, as well as background of what EZGUI actually does under the hood, such as what API's it may call to accomplish a task.

        You won't often find this kind of tech support from other companies.
        Chris Boss
        Computer Workshop
        Developer of "EZGUI"
        http://cwsof.com
        http://twitter.com/EZGUIProGuy

        Comment


        • #5
          FAQ:

          What makes EZGUI so different ?

          It does many things you just never thought you could do before. For example, EZGUI supports multiple monitor features of Windows. It has a unique Layer engine which allows you to define controls on different layers and then show and hide controls by layer. It provides support for drawing using Themes. You can customize the common dialogs and even add child forms to them. How about being able to scale, rotate up to 360 degrees and alphablend (or transparent draw) a bitmap all in one command ? How about creating a hybrid graphic window with a real Canvas background (2D drawing) with 3D floating objects on top of it ? You can implement not only drag and drop in a Listview or treeview control, but what about having an autoscroll feature (drag item beyond visible area and have control autoscroll items for you) ?

          The list goes on. EZGUI does so many things you likely have never done before, you will be amazed at what you can accomplish with it.EZGUI makes complex tasks easy to do.

          Chris Boss
          Computer Workshop
          Developer of "EZGUI"
          http://cwsof.com
          http://twitter.com/EZGUIProGuy

          Comment


          • #6
            FAQ:

            What is the Visual Design engine in EZGUI ?

            EZGUI provides a command set, plus an internal engine to run it, which allows you to build a visual designer. You can use it to build your own programming visual designer, or a report generator or any other type app which works similarly.

            EZGUI does this by embedding the visual designer drag and drop engine into its subclassing engine. In essence what it does is when you subclass any control (even custom controls) it provides access to the drag and drop engine so you can resize and drag control using the visual designer engine. It supports a snap to grid, provides commands for drawing (rubberbanding) a rectangle which will define where a control will go. To prevent a control from responding to user input during edit mode, it turns off all user input via its subclassing engine. There is also a drag engine for displaying multiple drag rectangles at one time, even hundreds at one time, which is how you drag multiple controls at one time.

            The command set is as follows:

            Visual Designer Drag and Drop Commands:

            EZ_HandleCtrl (Drag Handle Control)

            EZ_SubClass
            EZ_SubClassMode
            EZ_SetCapture
            EZ_SetDragRectAttributes
            EZ_SetFGrid
            EZ_SetGridColor
            EZ_SnapControl
            EZ_SetAutoRedrawState
            EZ_SetFGridHOffset
            EZ_SetGrid
            EZ_SetGridCharSize
            EZ_SetGridDisplay
            EZ_SetGridPosByChar
            EZ_SetWDragMode
            EZ_SetCaptureEX
            EZ_AddDragRect
            EZ_DisableSnapTo
            EZ_EnableSnapTo
            EZ_GetDragPos
            EZ_SetCaptureD
            EZ_StopDrag


            Key to all of this is the Drag handle control. It is a custom control which can have any other control defined as its "buddy". Once defined, it handles all the drag operations and displays the drag handles over the control. Drag handles can be displayed either outside or inside of the buddy control.

            No other addon for Powerbasic that I know of provides this kind of engine. It is unique to EZGUI.

            Chris Boss
            Computer Workshop
            Developer of "EZGUI"
            http://cwsof.com
            http://twitter.com/EZGUIProGuy

            Comment


            • #7
              FAQ:

              What are layers ?

              EZGUI has a layer engine which Is quite unique. Windows does not have a layer engine, so this is a proprietary engine which is probably the most useful feature in EZGUI and most users value it.

              EZGUI allows you to define controls as they are created onto a specific layer from -1 to 99. -1 means ignore and don't assign to any layer. 0 means background layer which is always showing. Layers 1 to 99 are separate layers where only one shows at a time (plus the background layer). Now this is where it gets interesting. EZGUI has a command called EZ_DisplayLayer. If I have say 5 layers (1 to 5) and I asked EZGUI to display Layer 3, it will hide layers 1,2 and 4,5 and then show layer 3 (plus layer 0 the background layer). When it hides and shows controls, it does not simply hide and show them one at a time, since that would produce terrible flicker. EZGUI prevents the controls from be repainted when then are hidden and shown. It goes through its internal list of controls showing and hiding the appropriate controls. It then flags the regions where a control is either hidden or shown and generates a region for repainting so only what needs to be repainted is. Then EZGUI repaints the entire region all at one time, so the controls appear to display together at the same time. This eliminates much of the flicker one would get otherwise.

              Tab controls can be implemented via layers, so no child forms are required for a tab control. You can use Layers for creating Wizard style dialogs.
              Chris Boss
              Computer Workshop
              Developer of "EZGUI"
              http://cwsof.com
              http://twitter.com/EZGUIProGuy

              Comment


              • #8
                FAQ:

                How does EZGUI reference Forms ?

                One of the problems with Forms / Dialogs in Windows is that you have to store a handle for it using a Global variable. Unlike controls where you can define a control ID (and using its parent handle get the controls handle), apps with many forms can be a pain because you have to have so many global variables to store the handles.

                EZGUI makes coding a lot easier, by referencing Forms using a name (a string). For example you could name a Form "MyMainForm" and then reference it anywhere in code using its name. EZGUI maintains a list of form names internally and it turns the name into all capitals. For example you could set the text for a Forms caption bar using:

                EZ_SetText "MyMainForm", 0, "This is my caption bar text"

                also you can do it this way:

                EZ_SetText "MYMAINFORM", 0, "This is my caption bar text"

                Either way works. EZGUI always converts the name you pass to it to uppercase characters before testing the name to see if it matches its internal list.

                You don't have to store any handles for forms. Now if you need the actual handle, say for calling a WIN32 API, then you simply use the EZ_Handle function to get it like this:

                hWnd& = EZ_Handle ("MyMainForm",0)

                You can get handles for controls the same way by passing a control ID for the second parameter like this:

                hCtrl& = EZ_Handle ("MyMainForm", SomeControlID&)

                EZGUI has an event engine where it generates events for forms and controls, so you don't have to write a Dialog or Window procedure, nor do you use callbacks like DDT does. Instead you simply use the EZ_Events routine all EZGUI apps must have where it passes events to all the forms and controls in the app in one procedure (you can parse them out into secondary routines for clarity if you like, kind of like message wrappers API programmers use). EZGUI translates many common window messages into easy to use events. The event routine is passed the following parameters:

                EZ_Events FormName$, Control_ID& , ControlEventMsg& , ControlEventMsgValue&, CancelEventFlag&

                EZGUI uses simpler names for the parameters when you code (ie. using the Visual Designer) like this:

                EZ_Events FormName$, CID&, CMsg& , CVal& , Cancel&

                EZGUI's event engine passes the form name and control ID (zero if event is for form itself) to this routine. The event is simply a constant defined in the EZGUI include file like %EZ_Click, %EZ_DClick, %EZ_Change .

                If an event requires a value passed (ie. scrollbar position changes in %EZ_Change and the new position is passed) then it passes it in ControlEventMsgValue& . If the event needs to pass something more complicated that just a single integer value, then the parameter contains a pointer to a structure and EZGUI has a matching command where it can read the structure and return all the values like this:

                Code:
                CASE %EZ_SubClass  ' event value passed in CMsg&
                    DIM hCtrl&, Msg&, wParam&, lParam&, X&, Y&
                    EZ_GetSubClass CVal&, hCtrl&, Msg&, wParam&, lParam&
                    IF EZ_IsMsg(Msg&, "B") THEN   ' button message
                         EZ_GetMouseXY lParam&, X&, Y&
                         DoSomeThingSub X&, Y&
                    END IF
                 END IF
                So you don't have to use pointers. Just pass the CVal& value to the supporting command the event comes with and it handles reading the pointer data for you.

                EZGUI also has a Form Macro which can be used in most events. If you want to call commands using the same form name as the event was generated for, you can simply use the form macro "{ME}" instead. EZGUI knows which form generated the event, so any commands which require a form name and you are using the same form name as the event was generated by (which is most of the time), you can simply use the "{ME}" macro instead and EZGUI knows what the form name is.



                Chris Boss
                Computer Workshop
                Developer of "EZGUI"
                http://cwsof.com
                http://twitter.com/EZGUIProGuy

                Comment


                • #9
                  FAQ:

                  Is there anything I can download which demonstrates what EZGUI can do ?

                  Yes, there is. While there is no demo version of EZGUI, I do have a few downloads which may interest you.

                  My test app I wrote using EZGUI which demonstrates the following features: http://cwsof.com/download/testwin8.zip
                  • Splash screens (forms)
                  • Rebar forms
                  • MDI Parent and MDI child
                  • Pager forms
                  • Tiling bitmaps on form background
                  • Stretching bitmaps on form background
                  • Non-rectangular forms using complex regions
                  • 2D and 3D colored buttons (using simplified ownerdraw engine)
                  • Simplified ownerdraw listbox, combobox
                  • Advanced (low level) Listview
                  • Customdraw listview and treeview
                  • Custom controls - File listbox , Property Listbox, Shape control, Hotspot control
                  • Visual Designer engine demo
                  • Listview and Treeview drag and drop plus autoscrolling engine
                  • MCI video and MIDI audio
                  • Turtle Graphics contorl
                  • Canvas control
                  • 2D Sprite engine
                  • 3D canvas control and 3D animation using 3D scripting language

                  Here is another test app which demonstrates a 3D model viewer app (displays STL models): http://cwsof.com/download/ezmodvw11.zip

                  This one you can also get the source code to look at here: http://cwsof.com/download/ez3dview.zip

                  Both apps above are 100% written using EZGUI 5.0 Pro. Not a single WIN32 API call (and no DDT either) are used in either app, but only the EZGUI runtime command set.




                  Chris Boss
                  Computer Workshop
                  Developer of "EZGUI"
                  http://cwsof.com
                  http://twitter.com/EZGUIProGuy

                  Comment


                  • #10
                    FAQ:

                    Can I see a demonstration of how the Visual Designer works ?

                    Yes, I have some Youtube videos online you can watch. Here is one:



                    If you want to watch more videos, check out my YouTube channel here: https://www.youtube.com/user/Compute...able_polymer=1

                    Chris Boss
                    Computer Workshop
                    Developer of "EZGUI"
                    http://cwsof.com
                    http://twitter.com/EZGUIProGuy

                    Comment


                    • #11
                      FAQ:

                      Are there any sample projects or code that comes with EZGUI 5.0 Pro ?

                      Yes, there is! There are actually two different styles of sample code that comes with EZGUI. The first uses the hand coding style. Yes, you can hand code apps using EZGUI and not require using the Visual Designer. EZGUI was actually designed specifically for hand coding apps without a Visual Designer. There is a folder in EZGUI called "codeclips" which contains the following samples:


                      bitmapvw.bas - Working with Canvas DIB buffers directly

                      bitmapzm.bas - Zoom Image in Canvas control

                      canvas2.bas - Drawing and Scrolling Canvas Image

                      canvas3.bas - Draw and animated Canvas (uses EZ_CalcPoint)

                      canvasth.bas - Animating Canvas using old style Threads

                      canvrg.bas - Draw on Canvas and generate a region (non rect Canvas)

                      clipbrd.bas - Copy/Paste text from clipboard into Text Box

                      colors.bas - Display all builtin Colors and 3D patterns

                      cursor.bas - Change Cursor over controls

                      custdrw.bas - CustomDraw with a ToolBar

                      custdrw1.bas - CustomDraw with a Listview

                      custdrw2.bas - CustomDraw with a Treeview

                      dialogs.bas - Common Dialogs (File,Color, Font, BrowseFolder)

                      dragcanv.bas - Drag Canvas control around using mouse

                      dragdrop.bas - Drag and Drop with Listview and Treeview

                      drawavi.bas - Moving Animation control frames one at a time

                      enumchng.bas - Enumerate Controls and move to another Form

                      enumform.bas - Enumerate Controls

                      finddlg.bas - Display Find Text Dialog and see its Events

                      flistbox.bas - Files ListBox control

                      flistbx2.bas - Files Listbox using custom icons

                      fonts.bas - Display Fonts using ownerdraw listbox

                      fontsize.bas - Changing Font Size using Point Size and a Width

                      fonttest.bas - Using Fonts with Controls

                      ifonts.bas - New IFonts feature

                      keyevent.bas - Trapping Keyboard Events

                      keypress.bas - Using a Message Loop Hook procedure

                      listbox.bas - Common Listbox tasks including searches

                      listvw.bas - Working with the Listview control

                      masktext.bas - Masked Edit control

                      msgboxex.bas - Extended MessageBox

                      odraw.bas - New Simplified OwnerDraw command set

                      odrawlv.bas - OwnerDraw Listview control (advanced)

                      odrawts2.bas - OwnerDraw Listview, Tab, Combobox (advanced)

                      owndrlvh.bas - OwnerDraw Listview Headers (advanced)

                      ownforms.bas - Using Owned Child Forms (advanced)

                      pager.bas - Pager Control

                      plistbox.bas - Properties Listbox control

                      popupmnu.bas - Right Click Popup Menu on Textbox

                      prnttest.bas - Printer Test

                      ptsize.bas - Combobox Control changes displayed Font Size

                      regions.bas - Using regions on Button controls

                      resize1.bas - Resizing forms and controls

                      resource.bas - Finding Resource names

                      RTFlink.bas - Hyperlinks in RichEdit control

                      scrollcv.bas - Scroll a Canvas control using a Page form parent

                      scroller.bas - Scroller Controls (scrollbar, updown, trackbar)

                      scrollw.bas - Scroll a Form

                      sprites.bas - Sprites example

                      tbaraddi.bas - Append custom Toolbar Bitmap with builtin Bitmaps

                      tbarhot.bas - Toolbar using HotSpot Images

                      texture2.bas - Using 3D pattern background colors

                      timer2.bas - Timer Digital Clock

                      timer.bas - Timer with Splash screen and Progress Bar changes

                      toolbars.bas - Multiple Toolbar styles and drop down menus

                      tooltips.bas - ToolTip examples

                      tpalette.bas - Turtle Control default Color Palettes

                      trayicon.bas - Using Tray Icons

                      treeview.bas - Treeview example

                      turtdraw.bas - Visually Drawing on a Turtle Graphics Control

                      turtle.bas - Using a Turtle Graphics Control

                      vdesign1.bas - Visual Designer Engine features (draw, drag, drop)

                      xlines.bas - Moving hairlines over Canvas control using mouse

                      zipcode.bas - Demonstrates using BTree engine

                      zoomimg.bas - Capture area over cursor and zoom in

                      zorder.bas - Demonstrate changing ZOrder of controls


                      The next style of sample code is actual projects created using the Visual Designer. These are a bit more complex and they demonstrate not only working with the Visual Designer (they require using the visual designer when compiling them). The following example projects are in the examples folder:

                      Sprites Demo



                      This project demonstrates using the Sprite engine, 3D OwnerDraw Button controls and how to use a Game Loop.

                      Text Editor



                      This project demonstrates using MDI (Multiple Document Interface) Forms in an application, a ToolBar, Open/Save File Common Dialogs and the Text (Edit) control.

                      RTF Editor



                      This project demonstrates using MDI (Multiple Document Interface) Forms in an application, a Rebar control and Rebar Form, a ToolBar, Open/Save File Common Dialogs, 3D OwnerDraw Button controls, OwnerDraw Comboboxes , the simplified OwnerDraw command set and the RichText (RichEdit) control (plus how to set fonts and colors in a RichEdit control).

                      Threads



                      This project demonstrates using Canvas controls, drawing on Canvas controls, using the new simplified Thread command set and Thread events.

                      MCI



                      This project demonstrates using a Shaped Form (non-rectangular Form using a Bitmap region), 3D Ownerdraw Button controls, MCI control and MCI command set.

                      It also demonstrates how to hide parts of a Form by changing its size dynamically.



                      Chris Boss
                      Computer Workshop
                      Developer of "EZGUI"
                      http://cwsof.com
                      http://twitter.com/EZGUIProGuy

                      Comment


                      • #12
                        FAQ:

                        Doesn't EZGUI force me into a "black box" engine which limits me from customization ?

                        Absolutely NOT !!!

                        EZGUI feature set provides so many low level commands that you can customize it many, many ways. Even EZGUI's internal engines have Hook commands which lets you gain access at a low level. EZGUI also provides many support functions which let you get access to things like font, brush, bitmap and window handles when you need to call the WIN32 API.
                        Chris Boss
                        Computer Workshop
                        Developer of "EZGUI"
                        http://cwsof.com
                        http://twitter.com/EZGUIProGuy

                        Comment


                        • #13
                          FAQ:

                          Tell me something EZGUI does that I likely wouldn't be able to do easily using the WIN32 API ?

                          One thing is the combination of doing ownerdraw using Themes. EZGUI provides a drawing command set which can access the current Windows Theme. If theming is turned off, then EZGUI will fall back to the GDI. EZGUI can automatically load the Window Theme OS DLL when needed and draw using it. EZGUI accesses the most commonly used Theme features.

                          Now combine that with ownerdraw and you can create new controls using ownerdraw, but having a themed look. That makes your app look new and modern.

                          The EZGUI Draw command (EZ_DCDraw, EZ_CDraw) has the following Theme UI elements it can draw:

                          Theme Aware objects:



                          %EZ_XBTNUP - Close (X) Button up

                          %EZ_XBTNDN - Close (X) Button down

                          %EZ_HBTNUP - Help Button up

                          %EZ_HBTNDN - Help Button down

                          %EZ_MXBTNUP - Maximize Button Up

                          %EZ_MXBTNDN - Maximize Button down

                          %EZ_MNBTNUP - Minimize Button up

                          %EZ_MNBTNDN - Minimize Button down

                          %EZ_RBTNUP - Restore Button up

                          %EZ_RBTNDN - Restore Button down

                          %EZ_CAPA - Caption Bar Active (square style)

                          %EZ_CAPI - Caption Bar InActive (square style)

                          %EZ_CAPAR - Caption Bar Active (rounded style)

                          %EZ_CAPIR - Caption Bar InActive (rounded style)

                          %EZ_TABBG - Tab Control Background

                          %EZ_TABBGF - Tab Control Background with a Flat border

                          %EZ_REBARBG - Rebar Background


                          Chris Boss
                          Computer Workshop
                          Developer of "EZGUI"
                          http://cwsof.com
                          http://twitter.com/EZGUIProGuy

                          Comment


                          • #14
                            FAQ:

                            Why use a GUI framework rather than simply use a set of API wrappers ?

                            EZGUI is a GUI framework and it is designed to simplify writing GUI apps. API wrappers often are overly simple and just make it easier to call an API. A GUI framework automates many tasks for you and it can accomplish much more complex tasks. One example is EZGUI's event engine which does a lot of preprocessing under the hood. Events have already had much work done for you already when your app gets the event. For example, for scrollbars EZGUI automatically processes the internal scroll messages and increments/decrements the scrollbar position for you and then simply passes in the event (%EZ_Change) the new position of the scrollbar. A lot of coding is avoided this way and you can concentrate more on getting things done rather than handling a lot of mundane stuff just to handle default processing of many window messages.

                            A GUI framework also has many high level features which you simply won't get with a simple set of API wrappers. One example is EZGUI's autoresize engine, which can handle automatically resizing and moving controls when the parent form changes size.

                            Also a GUI framework can implement totally new high level features not found in the API at all. One example in EZGUI is the autoscroll feature in the drag and drop engine for the listview and treeview controls. This is not a feature found in the Windows API. Another is EZGUI's Visual Designer drag and drop engine. Again this is not a feature found in the Windows API and it is quite difficult to implement. For example try this in what ever visual designer you currently use. Create 100 controls on a form. Select all 100 controls and then try to drag them to move them all. Some designers will "choke" when this is done and you will get terrible flicker and delay in drawing. Now try again with 400 controls and see what happens. EZGUI's drag and drop engine is designed so it can move hundreds of controls seamlessly and cleanly with little or no flicker or delay. The reason for this is that EZGUI uses double buffering in the drag engine so no matter how many drag rectangles are displayed they all move together as one smoothly.

                            So, using a GUI framework has many benefits not found in a simple API wrapper command set.

                            Chris Boss
                            Computer Workshop
                            Developer of "EZGUI"
                            http://cwsof.com
                            http://twitter.com/EZGUIProGuy

                            Comment


                            • #15
                              FAQ:

                              Why would I need something like EZGUI if I already use another Visual Designer for Powerbasic ?

                              First, let me say that it is not a matter of one or the other. There is no reason why one can not have multiple "tools in their toolbox" for different situations.

                              That said, while other Designers may appear better because of the ease of use up front (the design phase), where EZGUI excels is on developing the backend or the "core" of an application. At some point with other tools, most users must resort to (or fall on) the Windows API. There may be some limited API wrappers provided with such tools, but at some point you will most likely reach their limit.

                              But with EZGUI it is quite different. Most EZGUI users rarely have to resort to the Windows API (or at most very, very little). EZGUI's feature set is so rich, it can in most instances allow you to develop extremely complex apps and user interfaces and never require a single call to the Windows API. EZGUI even does OpenGL 3D and no OpenGL calls required (no OpenGL headers either). Just consider something like Ownerdraw. I doubt any other Designer tool for Powerbasic can help you do ownerdraw without using a single line of API code. But with EZGUI you can do a great deal of ownerdraw, including Themed drawing and not use a single line of API code.

                              Most EZGUI users can compile their apps without using a single WIN32 or OpenGL include file. Imagine that ! No Powerbasic WIN32 include files! Not even Jose Roca's include files. Only the EZGUI include files which are tiny in comparison and are mostly for defining all the EZGUI sub/function calls in the GUI framework.

                              Just consider the one include file win32api.inc that one may use with Powerbasic 10 :

                              in that include are references to the following other API includes:

                              "SdkDdkVer.inc"
                              "NTStatus.inc"
                              "WinDef.inc"
                              "WTypes.inc"
                              "WinGDI.inc"
                              "WinUser.inc"
                              "Excpt.inc"
                              "WinResrc.inc"
                              "WinBase.inc"
                              "WinReg.inc"
                              "WinNLS.inc"
                              "CommDlg.inc"
                              "CommCtrl.inc"
                              "ShlObj.inc"
                              "ShellApi.inc"
                              "Mcx.inc"
                              "MMSystem.inc"
                              "UrlMon.inc"
                              "WindowsX.inc"

                              While not even counting any include references within them, the total size of all those include files is:

                              2335 KB or 2.3 megabytes

                              The EZGUI include files total:

                              97 KB

                              Yes, the standard WIN32 API files are 23 times larger in size than what is required for EZGUI. And that does not include something extra like OpenGL header files, if you were to use that in a WIN32 API with other tools.

                              And EZGUI gives you so many things not even found in the WIN32 API or with other Designers, like its own 3D custom control (with 3D scripting language), 2D sprite engine (animation), and a number of built in custom controls like its Property Listbox control, masked Edit control, Files Listbox control and more.


                              And just consider this. EZGUI is so feature rich that it is worth every penny of its normal $249 price. To be able to add it to your toolbox of tools for use with Powerbasic makes it an absolute deal at only $39 (current sale price). Why not add it to your PB toolbox today ?

                              Chris Boss
                              Computer Workshop
                              Developer of "EZGUI"
                              http://cwsof.com
                              http://twitter.com/EZGUIProGuy

                              Comment


                              • #16
                                Hallo,

                                is there a samplecode e.g. the address.bas with EZgui5.0 to see the whole work ?

                                Best regards.

                                Matthias Kuhn

                                Comment


                                • #17
                                  Matthias, there are two types of coding styles with EZGUI. One is hand coding where only three core subroutines are required (EZ_Main, EZ_DesignWindow and EZ_Events) and the other is when one uses the EZGUI visual designer, which has lots of subroutines generated , since the designer needs to keep things very modular and so it breaks up the code in much small routines (ie. each form and each control have their own event routines).

                                  Let me start with a hand coded one, where it is a bit more modular than just the three core routines:

                                  Code:
                                  #COMPILE EXE
                                  #DIM ALL                    '   This is helpful to prevent errors in coding
                                  
                                  ' --------------------
                                  #INCLUDE "..\includes\ezgui50.inc"                          ' EZGUI Include file for Declares
                                  ' --------------------
                                  ' *************************************************************************************
                                  
                                  
                                  
                                  
                                  ' *************************************************************************************
                                  '                         Application Constants and Declares
                                  ' *************************************************************************************
                                  DECLARE SUB Form1_Display(BYVAL Parent$)
                                  DECLARE SUB Form1_Design()
                                  DECLARE SUB Form1_Events(CID&, CMsg&, CVal&, Cancel&)
                                  ' ------------------------------------------------
                                  
                                  %FORM1_BUTTON1            = 100
                                  %FORM1_CANVAS1            = 105
                                  %FORM1_BUTTON2            = 110
                                  %FORM1_BUTTON3            = 115
                                  %FORM1_CHECK1             = 120
                                  
                                  ' ------------------------------------------------
                                  
                                  DECLARE SUB FORM1_BUTTON1_Click()
                                  DECLARE SUB FORM1_BUTTON2_Click()
                                  DECLARE SUB FORM1_CANVAS1_Click()
                                  DECLARE SUB FORM1_BUTTON3_Click()
                                  
                                  ' --------------------
                                  #INCLUDE "..\includes\ezwmain50.inc"                          ' EZGUI Include file for WinMain
                                  ' --------------------
                                  
                                  ' *************************************************************************************
                                  '                               EZGUI Program Control Functions
                                  ' *************************************************************************************
                                  
                                  SUB EZ_Main(VerNum&)
                                      LOCAL F$
                                      ' -----------------------------------------------------------------------
                                      EZ_DefCharSize 8, 16        ' forces EZGUI to not scale with Large fonts.
                                      ' -----------------------------------------------------------------------
                                      Form1_Display ""
                                  END SUB
                                  
                                  ' -------------------------------------------------------------------------------------
                                  
                                  SUB EZ_DesignWindow(FormName$)
                                      '      - NOTE:   EZGUI passes back Form Name in uppercase letters
                                      SELECT CASE FormName$
                                          CASE "FORM1"
                                              Form1_Design
                                          CASE ELSE
                                      END SELECT
                                  END SUB
                                  
                                  ' -------------------------------------------------------------------------------------
                                  
                                  SUB EZ_Events(FormName$, CID&, CMsg&, CVal&, Cancel&)
                                      SELECT CASE FormName$
                                          CASE "FORM1"
                                              Form1_Events CID&, CMsg&, CVal&, Cancel&
                                          CASE ELSE
                                      END SELECT
                                  END SUB
                                  
                                  ' -------------------------------------------------------------------------------------
                                  
                                  
                                  
                                  
                                  ' *************************************************************************************
                                  '                                 Put Your Code Here
                                  ' *************************************************************************************
                                  
                                  SUB Form1_Display(BYVAL Parent$)
                                      EZ_Color -1, -1
                                      EZ_Form "FORM1", Parent$, "Canvas Demo - EZ_CalcPoint demonstration", 0, 0, 50, 32, "C"
                                  END SUB
                                  ' ------------------------------------------------
                                  
                                  SUB Form1_Design()
                                      LOCAL FF&
                                      '---------------------------------------------------------------
                                      FF& =  9              '          -  Offset for Font Numbers
                                      '---------------------------------------------------------------
                                      EZ_Color-1,-1
                                      EZ_UseFont -1
                                      EZ_UseFont 4
                                      EZ_Button %FORM1_BUTTON1, 3, 27, 14, 2, "Draw on Canvas (2D)", "T"
                                      EZ_Button %FORM1_BUTTON2, 18.5, 27, 14, 2, "Draw on Canvas (3D)", "T"
                                      EZ_Button %FORM1_BUTTON3, 34, 27, 14, 2, "Animate Canvas", "T"
                                      EZ_Color 15,4
                                      EZ_CheckBox %FORM1_CHECK1, 12, 30,26,1.25, "Use Real Coordinates for Canvas Size !", "T"
                                      EZ_Color -1, -1
                                  
                                      ' --------------------------------------------------------------
                                      EZ_UseFont 4
                                      EZ_Color 15,15
                                      EZ_Canvas %FORM1_CANVAS1, 6, 1, 38, 25, "F+"
                                  
                                      ' --------------------------------------------------------------
                                  END SUB
                                  ' ------------------------------------------------
                                  
                                  SUB Form1_Events(CID&, CMsg&, CVal&, Cancel&)
                                      SELECT CASE CID&
                                          CASE %EZ_Window
                                              IF CMsg&=%EZ_Close THEN
                                              END IF
                                          CASE  %FORM1_BUTTON1
                                              IF CMsg&=%EZ_Click THEN
                                                  FORM1_BUTTON1_Click
                                              END IF
                                          CASE  %FORM1_BUTTON2
                                              IF CMsg&=%EZ_Click THEN
                                                  FORM1_BUTTON2_Click
                                              END IF
                                          CASE  %FORM1_BUTTON3
                                              IF CMsg&=%EZ_Click THEN
                                                  FORM1_BUTTON3_Click
                                              END IF
                                          CASE  %FORM1_CANVAS1
                                              IF CMsg&=%EZ_Click THEN
                                                  FORM1_CANVAS1_Click
                                              END IF
                                          CASE ELSE
                                      END SELECT
                                  END SUB
                                  ' ------------------------------------------------
                                  
                                  GLOBAL App_FastDrawFlag&
                                  
                                  SUB SetDrawSpeed()
                                      IF EZ_GetCheck("Form1",%FORM1_CHECK1) THEN
                                          App_FastDrawFlag&=1
                                      ELSE
                                          App_FastDrawFlag&=0
                                      END IF
                                  END SUB
                                  
                                  SUB DrawCanvasPicture1()
                                      LOCAL CW&, CH&, PW&
                                      LOCAL X1&,Y1&, DX&, DY&, X2&, Y2&
                                  
                                      CW&=800     ' emulate 8 inches by .01 inch units
                                      CH&=1050    ' emulate 10.5 inches by .01 inch units
                                  
                                      IF App_FastDrawFlag& THEN
                                          EZ_GetCanvasSize "Form1", %FORM1_CANVAS1, CW&, CH&
                                      END IF
                                  
                                      DX&=CW&/4
                                      DY&=CH&/4
                                  
                                      X1&=DX&
                                      Y1&=DY&
                                  
                                      PW&=CW&/80!
                                  
                                      EZ_StartDraw "Form1", %FORM1_CANVAS1, CW&, CH&, "V"
                                      EZ_Color 15,15
                                      EZ_CDraw %EZ_RECT, 0, 0, CW&-1, CH&-1, 1, 1
                                  
                                      EZ_Color 0,15
                                      EZ_CalcPoint X1&, Y1&, DX&*2, 90, X2&, Y2&
                                      EZ_CDraw %EZ_Line, X1&, Y1&, X2&, Y2&, PW&, 1
                                  
                                      EZ_CalcPoint X2&, Y2&, DY&*2, 180, X1&, Y1&
                                      EZ_CDraw %EZ_Line, X2&, Y2&, X1&, Y1&, PW&, 1
                                  
                                      EZ_CalcPoint X1&, Y1&, DX&*2, 270, X2&, Y2&
                                      EZ_CDraw %EZ_Line, X1&, Y1&, X2&, Y2&, PW&, 1
                                  
                                      EZ_CalcPoint X2&, Y2&, DY&*2, 0, X1&, Y1&
                                      EZ_CDraw %EZ_Line, X2&, Y2&, X1&, Y1&, PW&, 1
                                  
                                      EZ_Color 0, 4
                                      X1&=CW&/2
                                      Y1&=CH&/2
                                      EZ_CDraw %EZ_FLOODFILLB, X1&,Y1&,0,0,1,1
                                      EZ_EndDraw
                                  
                                  END SUB
                                  
                                  
                                  SUB DrawCanvasPicture2()
                                      LOCAL CW&, CH&, PW&
                                      LOCAL X1&,Y1&, DX&, DY&, X2&, Y2&
                                  
                                      CW&=800     ' emulate 8 inches by .01 inch units
                                      CH&=1050    ' emulate 10.5 inches by .01 inch units
                                  
                                      IF App_FastDrawFlag& THEN
                                          EZ_GetCanvasSize "Form1", %FORM1_CANVAS1, CW&, CH&
                                      END IF
                                  
                                      DX&=CW&/4
                                      DY&=CH&/4
                                  
                                      X1&=DX&
                                      Y1&=DY&
                                  
                                      PW&=CW&/80!
                                  
                                  
                                      EZ_StartDraw "Form1", %FORM1_CANVAS1, CW&, CH&, "V"
                                      EZ_Color 15,15
                                      EZ_CDraw %EZ_RECT, 0, 0, CW&-1, CH&-1, 1, 1
                                  
                                      EZ_Color 0,15
                                      EZ_CalcPoint X1&, Y1&, DX&*2, 70, X2&, Y2&
                                      EZ_CDraw %EZ_Line, X1&, Y1&, X2&, Y2&, PW&, 1
                                  
                                      EZ_CalcPoint X2&, Y2&, DY&*2, 180, X1&, Y1&
                                      EZ_CDraw %EZ_Line, X2&, Y2&, X1&, Y1&, PW&, 1
                                  
                                      EZ_CalcPoint X1&, Y1&, DX&*2, 250, X2&, Y2&
                                      EZ_CDraw %EZ_Line, X1&, Y1&, X2&, Y2&, PW&, 1
                                  
                                      EZ_CalcPoint X2&, Y2&, DY&*2, 0, X1&, Y1&
                                      EZ_CDraw %EZ_Line, X2&, Y2&, X1&, Y1&, PW&, 1
                                  
                                      EZ_Color 0, 4
                                      X1&=CW&/2
                                      Y1&=CH&/2
                                      EZ_CDraw %EZ_FLOODFILLB, X1&,Y1&,0,0,1,1
                                      EZ_EndDraw
                                  
                                  END SUB
                                  
                                  
                                  ' ------------------------------------------------
                                  SUB FORM1_BUTTON1_Click()
                                      SetDrawSpeed
                                      DrawCanvasPicture1
                                  END SUB
                                  ' ------------------------------------------------
                                  
                                  SUB FORM1_BUTTON2_Click()
                                      SetDrawSpeed
                                      DrawCanvasPicture2
                                  END SUB
                                  
                                  
                                  SUB FORM1_BUTTON3_Click()
                                      LOCAL CT!, N&, S!
                                      SetDrawSpeed
                                      S!=.05
                                      CT!=TIMER
                                      FOR N&=1 TO 20
                                          DrawCanvasPicture1
                                          EZ_DoEvents 5
                                          EZ_Delay S!
                                          DrawCanvasPicture2
                                          EZ_DoEvents 5
                                          EZ_Delay S!
                                      NEXT N&
                                  END SUB
                                  
                                  ' ------------------------------------------------
                                  SUB FORM1_CANVAS1_Click()
                                  END SUB
                                  ' ------------------------------------------------

                                  Chris Boss
                                  Computer Workshop
                                  Developer of "EZGUI"
                                  http://cwsof.com
                                  http://twitter.com/EZGUIProGuy

                                  Comment


                                  • #18
                                    Let me explain the three core routines:

                                    EZGUI is not simply a set of API wrappers, but it is a GUI engine. This means it controls your app and only calls your code when one of three situations arise:

                                    (1) EZ_Main

                                    This is the starting point of your app. It is not the same as PBMain or Winmain. The EZGUI runtime has its own Winmain code, so when the runtime needs to give you a chance to start your app, it calls the EZ_Main routine in your code. There you can define things like fonts or colors you want to use and you need to create at least one Form or the app terminates. Forms are created using the EZ_Form command. In the above example, EZ_Main calls a routine which calls EZ_Form. Once EZ_Main is finished, control returns back to the EZGUI engine and it only calls your code when an event occurs.

                                    (2) EZ_DesignWindow

                                    EZGUI is a bit more like SDK programming, rather than DDT, in that it expects you to add the controls to a form in WM_CREATE. DDT works differently than SDK coding and it has you code controls right after the dialog declaration. In EZGUI, when you create a new Form, the EZ_Form command creates the form and internally in the GUI engine, in the forms WM_CREATE code it calls this second core routine, EZ_DesignWindow, immediately. This means that before EZ_Form finishes executing, a call to EZ_DesignWindow is made. in EZ_DesignWindow the forms name is passed so you know what form is requesting its controls be added to it. In this routine, You can add menus (only the main menu first entry is created before calling EZ_Form), controls, etc to your form. This code is being executed before the Form is visible.

                                    (3) EZ_Events

                                    Once EZ_Main is called and after EZ_DesignWindow is called for the current form, all control goes back to the EZGUI runtime. No code in your app is being executed. Only when an event occurs, will any more of your code be executed. When an event occurs (user interaction) will the EZ_Events routine be called. That routine is passed the name of the form and the ID of the control that generated the event (ie. a Button generates the %EZ_Click event). If the form generates the event itself, rather than a control, the control ID passed will be zero. If the control ID is zero, then you know that the event is for the form only.

                                    In EZGUI Forms have names, not handles (even though you can get the actual handle if needed).

                                    In EZGUI controls have ID's, similar to how one works with DDT (again the actual handle can be gotten if you need it)



                                    Chris Boss
                                    Computer Workshop
                                    Developer of "EZGUI"
                                    http://cwsof.com
                                    http://twitter.com/EZGUIProGuy

                                    Comment


                                    • #19
                                      Now let's look at a more complex application, one generated using the Visual Designer. This example is a mini wordprocessor which uses the RichEdit control for RTF text display. It also uses ownerdraw for some of its controls. It is kind of a Wordpad like program.

                                      Click image for larger version

Name:	ezword.png
Views:	1
Size:	28.0 KB
ID:	767490


                                      Code:
                                      ' *************************************************************************************
                                      '                    Code Generated by EZGUI Professional Visual Designer 5.0
                                      '           Portions: Copyright Christopher R. Boss, 2003 to 2011 All Rights Reserved !
                                      '              Registered EZGUI 5.0 users may use generated 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
                                      ' --------------------
                                      #INCLUDE "C:\ezgui45beta\includes\ezgui50.inc"                          ' EZGUI Include file for Declares
                                      ' --------------------
                                      #RESOURCE ".\rcdata\mdirich.pbr"
                                      #INCLUDE "C:\ezgui 5 demos\reg.inc"
                                      ' *************************************************************************************
                                      
                                      
                                      ' *************************************************************************************
                                      '                   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 FParent$)
                                      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 FParent$, 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 FMode&, 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 FParent$)
                                      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 FMode&)
                                      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:\ezgui45beta\includes\ezwmain50.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 %EZ5_CUST,%EZ5_REG
                                           EZ_DefImageFolder "Graphics"
                                           EZ_AllowCommandEvents  0
                                           EZ_LoadImageLib ""
                                           EZ_DefFont 6, "Arial", 10, "L+V"
                                           EZ_DefFont 7, "Courier New", 14, "L+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, &H00B96FFF
                                           EZ_DefColorL 37, &H0014AB9F
                                           EZ_DefColorL 38, &H0047A7FF
                                           EZ_DefColorL 39, &H00D2AACF
                                           EZ_DefColorL 40, &H001CD5E3
                                           EZ_DefColorL 41, &H00BC8943
                                           EZ_DefColorL 42, &H006C6AB7
                                           EZ_DefColorL 43, &H00DD4489
                                           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 FParent$)     ' (PROTECTED)
                                           LOCAL hMainMenu&
                                           ' Main Menu handle automatically stored by EZGUI
                                           hMainMenu&=EZ_DefMainMenu( %MDIPARENT_MENUFILES, "&File", "")
                                           EZ_Color -1, -1
                                           EZ_Form "MDIPARENT", FParent$, "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_UseAutoSize "CT"
                                           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
                                           EZ_AddAutoSize "MDIParent", 25, "CT"
                                      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 FParent$, BYVAL AC!, BYVAL AR!)     ' (PROTECTED)
                                           EZ_Color -1, -1
                                           EZ_Form "MDICHILD", FParent$, "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_UseAutoSize "CT"
                                           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 FMode&, 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 FParent$)     ' (PROTECTED)
                                           EZ_Color 0, 32
                                           EZ_AllowLoadingEvent 2
                                           EZ_Form "PPFORM", FParent$, "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_UseAutoSize "CT-2"
                                           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_UseAutoSize "CT-2"
                                           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_UseAutoSize "CT-2"
                                           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_UseAutoSize "CT-2"
                                           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_UseAutoSize "CT"
                                           EZ_Label %PPFORM_LABEL1, 0, 0, 48.25, 2, "[[34,32,6]]", "CO"
                                           ' -----------------------------------------------
                                           EZ_Color 0, 15
                                           EZ_UseFont 4
                                           EZ_UseAutoSize "CT"
                                           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 FMode&)
                                      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_UseAutoSize "CT"
                                           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_UseAutoSize "CT-2"
                                           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_UseAutoSize "CT-2"
                                           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_UseAutoSize "CT-2"
                                           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_UseAutoSize "CT"
                                           EZ_ComboBox %TBAR2_FONTNAMES, 13.5, .625, 27.625, 13.25, "Custom Font", "$?AJOTV"
                                           EZ_SelectItem "TBAR2", %TBAR2_FONTNAMES, 0
                                           ' -----------------------------------------------
                                           EZ_Color-1,-1
                                           EZ_UseFont 4
                                           EZ_AllowLoadingEvent 2
                                           EZ_UseAutoSize "CT"
                                           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_UseAutoSize "CT"
                                           EZ_ComboBox %TBAR2_FONTCOLORS, 50.125, .625, 17.125, 13.25, "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_UseAutoSize "CT-2"
                                           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_UseAutoSize "CT-2"
                                           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_UseAutoSize "CT-2"
                                           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
                                      
                                      
                                      
                                      
                                      '<<END ALL FORMS>>    UnKnown Routines follow:
                                      #IF %EZ_NOSKIPCODE
                                      #ENDIF 'PARSE END


                                      Chris Boss
                                      Computer Workshop
                                      Developer of "EZGUI"
                                      http://cwsof.com
                                      http://twitter.com/EZGUIProGuy

                                      Comment


                                      • #20
                                        EZGUI comes with a number of sample code examples, in both styles (hand coded and designer generated projects). Here is a list of those examples:


                                        Here are all the Code Clips that come with EZGUI 5.0:



                                        bitmapvw.bas - Working with Canvas DIB buffers directly

                                        bitmapzm.bas - Zoom Image in Canvas control

                                        canvas2.bas - Drawing and Scrolling Canvas Image

                                        canvas3.bas - Draw and animated Canvas (uses EZ_CalcPoint)

                                        canvasth.bas - Animating Canvas using old style Threads

                                        canvrg.bas - Draw on Canvas and generate a region (non rect Canvas)

                                        clipbrd.bas - Copy/Paste text from clipboard into Text Box

                                        colors.bas - Display all builtin Colors and 3D patterns

                                        cursor.bas - Change Cursor over controls

                                        custdrw.bas - CustomDraw with a ToolBar

                                        custdrw1.bas - CustomDraw with a Listview

                                        custdrw2.bas - CustomDraw with a Treeview

                                        dialogs.bas - Common Dialogs (File,Color, Font, BrowseFolder)

                                        dragcanv.bas - Drag Canvas control around using mouse

                                        dragdrop.bas - Drag and Drop with Listview and Treeview

                                        drawavi.bas - Moving Animation control frames one at a time

                                        enumchng.bas - Enumerate Controls and move to another Form

                                        enumform.bas - Enumerate Controls

                                        finddlg.bas - Display Find Text Dialog and see its Events

                                        flistbox.bas - Files ListBox control

                                        flistbx2.bas - Files Listbox using custom icons

                                        fonts.bas - Display Fonts using ownerdraw listbox

                                        fontsize.bas - Changing Font Size using Point Size and a Width

                                        fonttest.bas - Using Fonts with Controls

                                        ifonts.bas - New IFonts feature

                                        keyevent.bas - Trapping Keyboard Events

                                        keypress.bas - Using a Message Loop Hook procedure

                                        listbox.bas - Common Listbox tasks including searches

                                        listvw.bas - Working with the Listview control

                                        masktext.bas - Masked Edit control

                                        msgboxex.bas - Extended MessageBox

                                        odraw.bas - New Simplified OwnerDraw command set

                                        odrawlv.bas - OwnerDraw Listview control (advanced)

                                        odrawts2.bas - OwnerDraw Listview, Tab, Combobox (advanced)

                                        owndrlvh.bas - OwnerDraw Listview Headers (advanced)

                                        ownforms.bas - Using Owned Child Forms (advanced)

                                        pager.bas - Pager Control

                                        plistbox.bas - Properties Listbox control

                                        popupmnu.bas - Right Click Popup Menu on Textbox

                                        prnttest.bas - Printer Test

                                        ptsize.bas - Combobox Control changes displayed Font Size

                                        regions.bas - Using regions on Button controls

                                        resize1.bas - Resizing forms and controls

                                        resource.bas - Finding Resource names

                                        RTFlink.bas - Hyperlinks in RichEdit control

                                        scrollcv.bas - Scroll a Canvas control using a Page form parent

                                        scroller.bas - Scroller Controls (scrollbar, updown, trackbar)

                                        scrollw.bas - Scroll a Form

                                        sprites.bas - Sprites example

                                        tbaraddi.bas - Append custom Toolbar Bitmap with builtin Bitmaps

                                        tbarhot.bas - Toolbar using HotSpot Images

                                        texture2.bas - Using 3D pattern background colors

                                        timer2.bas - Timer Digital Clock

                                        timer.bas - Timer with Splash screen and Progress Bar changes

                                        toolbars.bas - Multiple Toolbar styles and drop down menus

                                        tooltips.bas - ToolTip examples

                                        tpalette.bas - Turtle Control default Color Palettes

                                        trayicon.bas - Using Tray Icons

                                        treeview.bas - Treeview example

                                        turtdraw.bas - Visually Drawing on a Turtle Graphics Control

                                        turtle.bas - Using a Turtle Graphics Control

                                        vdesign1.bas - Visual Designer Engine features (draw, drag, drop)

                                        xlines.bas - Moving hairlines over Canvas control using mouse

                                        zipcode.bas - Demonstrates using BTree engine

                                        zoomimg.bas - Capture area over cursor and zoom in

                                        zorder.bas - Demonstrate changing ZOrder of controls



                                        The following projects generated by the Visual Designer are provided:


                                        Sprites Demo


                                        This project demonstrates using the Sprite engine, 3D OwnerDraw Button controls and how to use a Game Loop.


                                        Text Editor


                                        This project demonstrates using MDI (Multiple Document Interface) Forms in an application, a ToolBar, Open/Save File Common Dialogs and the Text (Edit) control.

                                        RTF Editor


                                        This project demonstrates using MDI (Multiple Document Interface) Forms in an application, a Rebar control and Rebar Form, a ToolBar, Open/Save File Common Dialogs, 3D OwnerDraw Button controls, OwnerDraw Comboboxes , the simplified OwnerDraw command set and the RichText (RichEdit) control (plus how to set fonts and colors in a RichEdit control).


                                        Threads


                                        This project demonstrates using Canvas controls, drawing on Canvas controls, using the new simplified Thread command set and Thread events.




                                        MCI


                                        This project demonstrates using a Shaped Form (non-rectangular Form using a Bitmap region), 3D Ownerdraw Button controls, MCI control and MCI command set.
                                        It also demonstrates how to hide parts of a Form by changing its size dynamically.



                                        Chris Boss
                                        Computer Workshop
                                        Developer of "EZGUI"
                                        http://cwsof.com
                                        http://twitter.com/EZGUIProGuy

                                        Comment

                                        Working...
                                        X