Codeless
   Generic
     Dialogs 
Version 2006 (c) Jacques Basaldúa
What is CGD?
License conditions
What languages are supported?
What operating systems are supported?
Where is the DLL?
How do I . . . ?
Creating CGD applications
CGD language definition
CGD types reference


  What is CGD?


    CGD is a codeless dialog system intended to simplify the development of Windows applications.

    1. A CGD application has a source file which is both the definition of a structured type and a set of commands defining how that record must show up as a dialog. If you are reading this in the CGD environment, press <Ctrl>-O to see a real dialog. The source file of this dialog is:

{<STARTDLG CGD20>}

    FontDefinition      = packed record
        name            : string [31];
        size            : integer;          {<MIN 6>}   {MAX 64}
        Bold            : boolean;
        Italic          : boolean
    end;

    PreviewWin          = packed record
        doPreview       : (pvNoPreview, pvPreviewOnTop, pvPreviewToRight);
        nul             : byte;             {<PRIVATE>}
        pvOnTimer       : boolean;
        pvOnEdChng      : boolean;
        pvX             : integer;          {<MIN 0>}
        pvY             : integer           {<MIN 0>}
    end;

{<DIALOG cgdOptions>}
    cgdOptions          = packed record
        OpeningLevel    : integer;          {<MIN 1>}   {MAX 16}
        tbButtons       : integer;          {<MIN 0>}   {MAX 8}
        isMetric        : boolean;
        hasDlgFrame     : boolean;
        hasThickFolders : boolean;
        HelpTimeout     : byte;             {<MIN 1>}   {MAX 16}    {>>In 1/4 second units}
        txColor         : cgdColor;
        bkColor         : cgdColor;
        ColorLighter    : cgdColor;
        ComboTxColor    : cgdColor;
        ComboBkColor    : cgdColor;
        EditTxColor     : cgdColor;
        EditBkColor     : cgdColor;
        StaticN         : FontDefinition;   {<LBOLD>}
        StaticBd        : FontDefinition;   {<LBOLD>}
        StaticIt        : FontDefinition;   {<LBOLD>}
        StaticBI        : FontDefinition;   {<LBOLD>}
        RadioFnt        : FontDefinition;   {<LBOLD>}
        ComboFnt        : FontDefinition;   {<LBOLD>}
        EditFnt         : FontDefinition;   {<LBOLD>}
        PreV            : PreviewWin;       {<LBOLD>}
        BoolMinX        : integer;          {<MIN 1>}
        BoolMinY        : integer;          {<MIN 1>}
        RadioMinX       : integer;          {<MIN 1>}
        RadioMinY       : integer;          {<MIN 1>}
        ComboMinX       : integer;          {<MIN 1>}
        EdStringX       : integer;          {<MIN 1>}
        EdNumberX       : integer;          {<MIN 1>}
        EdFnamX         : integer;          {<MIN 1>}
        EdPathX         : integer;          {<MIN 1>}
        EdPntCellX      : integer;          {<MIN 1>}
        EdColCellX      : integer;          {<MIN 1>}
        EdDTBoxX        : integer;          {<MIN 1>}
        EdMinY          : integer;          {<MIN 1>}
        ColorSampX      : integer;          {<MIN 1>}
        fullReadOnly    : boolean;
        autoAdjLength   : boolean;
        ParentClick     : boolean;
        ForceScrollbar  : (fsUseDefault, fsShowAlways, fsNeverShow)
    end;

{<ENDDIALOGS>}
    As you can see, this is just the definition of some Pascal types. The tags, such as {<DIALOG cgdOptions>} , are remarks for the Pascal compiler, but they are commands for the CGD compiler. The same source file, when compiled by the Pascal compiler, generates an .exe application and, when compiled by CGD, it generates a .cgd dialog file. This file is used by a DLL (called cgdrun20.dll) to edit a record of the type declared as a dialog.

    These dialogs are called codeless because, except for the 57 Kbytes of the library shared by all CGD applications, your application does not require any dialog handling code. Well, it requires a function call. (10 to 20 bytes.)

 

  CGD for the user:
  All dialogs have the same "look and feel", which is as "windowslike" as possible.
  Toolbars, buttons, edit controls, hints, etc. are standard controls.
  All buttons support Windows desktop user preferences.
  Keyboard management: Arrow keys, <Tab>, <Shift>-<Tab>, Right arrow (for expand), Left arrow (for collapse) are the same as in Windows Explorer.
  All dialogs support the clipboard in text mode automatically. You can copy the content of any dialog, paste it into any text editor and save it for later use. You can modify the whole dialog at once by just pasting that text into the dialog again.
  Edit controls support standard Windows copy, cut and paste.
  The whole dialog supports global undoing.
  If the application provides it (it is very easy), the whole dialog may be user configurable, supporting: big fonts, etc. for visually impaired users or just for customization.

The dialog toolbar:  


  CGD for the programmer:
  You get stable, version independent, dialogs without writing a line.
  You can modify (add new properties, etc.) your records without the nightmare of updating their dialog handlers.
  You are forced to structure you data to edit it in dialogs. This is a very clean practice. It is an ideal complement of the modern IDE's code completion features. It may seem somewhat strict at the beginning, but when you get used to it, it becomes natural and the best option.
  Your applications may be very small. Of course, the ideal situation is writing your own window object libraries, but it can also be easily called from component based applications. Check the Visual C and Visual Basic examples supplied.

  Just an example: This application includes window objects, a multiple area interface, a console/browser/editor, an HTML browser including JPEG support, a compiler, a reverse compiler, a C->Pas converter and a Basic->Pas converter in a single .exe file. (Of about 200 Kbytes!)


  CGD is something for you, if:

1.

  You like the dialogs.

2.

  You understand "low-level" programming issues such as: The size of the variables you use, the use of DLLs and API calls. At least these three and: If you intend to use previewing, GDI. If you intend to use modeless dialogs, Window procedures and message processing.

3.

  Your applications are not interface-based. You do not expect to drag-and-drop OLE objects to the dialogs, etc. CGD is specially well suited for CAD, Robotics, Simulation and Scientific applications and for any application handling complex objects with many user-editable properties. Specially, if you add new properties frequently. All applications in this website (www.dybot.com) are CGD applications, download them and decide by yourself.



  CGD is not for you, if:

1.

  You do not like the dialogs.

2.

  You use programming in languages in which "everything happens automatically". You don't like (or understand) the "details".

3.

  Your interfaces are more complex than what can be implemented with CGD, even with callback methods.


  License conditions


    1. This is copyrighted material. (c) Jacques Basaldúa, 1989-2006.

    2.
All Rights are Reserved.

    3. You may only copy or distribute:

        a. The complete CGD system as the original Cgd2006.exe file.
    or
        b. The library cgdrun20.dll together with your applications.

    You may not charge your customers for the copy of this program, except the usual prices of the medium in which it is included: E.g., a magazine or a shareware collection in CD format. You may not induce your buyers to believe that the price paid for your media gives them any right over this product.

    4. If you quote the manual or copy any file distributed with the system, you must provide the URL http://www.dybot.com/CGD to help locating the complete work.

    5. Disclaimer: The application works substantially as described in this manual. Quality is a major concern of our company. If you find any bugs in it, don't hesitate to contact us with a precise description that allows us to reproduce the misbehavior. We will do our best to fix the situation and send you a free bug fix. Nevertheless, we keep the exclusive right to determine what is a bug and what is not, and what correcting actions apply to each case. Also, we hereby declare that:

    There is no warranty for this program, to the extent permitted by applicable law, other than the replacement of the original package.

    This program is provided "AS IS" without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose.

    In no event will the copyright holder, or any other party who may redistribute the program, be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the program. Including but not limited to: loss of data, hardware damage, mechanical damage, losses sustained by you, losses sustained by third parties or a failure of the program to operate with any other programs.


   Registering:

    If a .cgd file is created with an unregistered CGD copy, the dialog will display the following message in its message output area:

   CGD file is not registered. See http://www.dybot.com/CGD

   
You may use unregistered CGD copies for evaluation or for educational purposes only. If you program professionally, you must register your CGD copy. A CGD license costs 90 Euro. Payment is always done via reliable payment operators such as PayPal. Payment details are explained at http://www.dybot.com/CGD/register.htm . Once your payment is received, we will send you a confirmation email including your invoice and your secret license number. This number must be included in your CGD sources to prevent CGD from displaying the message mentioned before.

  What languages are supported?

    CGD is a DLL library. Therefore, as the API itself, OpenGL, Winsock, etc. it is inherently language independent.

    The methods use standard HWND Window handles, LPCSTR (called pChar in Pascal) pointers to zero-ended strings to keep it as Windowslike as possible.

    It is easier to use CGD from Pascal (or Delphi), because:

       1. The compiler compiles Pascal sources.
       2. The header file cgdTypes.pas and the programming help (this help)
            are Pascal(Delphi)-oriented.
       3. All in-depth examples are written in Pascal.
       4. Records containing Pascal strings are understood directly.
       5. The environment and cgdrun20.dll are written in DD3 Pascal.

    Nevertheless, Pascal sources (records only) can be created automatically from C or VisualBasic source files. The CGD system also includes VisualBasic and VisualC programming examples, including both CGD sources and the code required to link the library.


  What operating systems are supported?

    Any 32 bit Microsoft Windows version (95 or later) and any truly Windows compatible operating system. It's a bad joke, but it shouldn't be. Why are other operating systems (namely Linux) not concerned about Windows compatibility is a question that has always baffled this author.

    Anyway, if someone is interested in porting this to other operating systems, do not hesitate to contact me at:

    cgd@dybot.com


  Where is the DLL?

    If you are reading this at the integrated environment, the setup application will already have copied or updated the dll (cgdrun20.dll) to the path returned by the API function: GetSystemDirectory(). Typical names are c:\windows\system (Windows 95), c:\winnt\system32 (Windows NT 4 or 2000) or c:\windows\system32 .

    If you distribute applications containing this dll, you should follow the recommendations at  installing CGD


  About this environment:


This program is intended to be used by programmers.

I am sure that you already guessed, that:

1.

  There is no "Save" because sources are only browsed. You can modify them with your favorite editor and just press <F4> each time you want to recompile. In case you really want to edit in the environment, press <Ctrl>-E (For Edit/Edit). Any modification is saved immediately or, at least, each time you compile!

2.

  Functions such as: Copy options as source or Copy all dialog texts just write out to the console and not to the clipboard. You are expected to select whatever you want from the console, copy it and paste it in your source files or spell checker.

3.

  CGD.exe does not include a spell checker. The function spell checking only separates text from commands and variable names to make your spell checking easy. Copy/paste that text into your checker and make any necessary corrections to your sources manually.

4.

  Since converters (C, Basic & CGD) to Pascal overwrite the xxx(c).pas, xxx(b).pas or xxx(g).pas files without prompting, it is a good idea to rename them and to open them as sources if you want to edit them manually.