[lazarus] Attempt at native Win32 Form

Jeffrey A. Wormsley daworm at cc.net
Sun Aug 1 20:58:54 EDT 1999


I was hoping to try ti get a first pass at a native Win32 form going this
weekend, but I am at a wall of misunderstanding that makes the great wall
of China look like a parking curb.  Maybe someone can help me out here.

Sorry for the long message, but it's the only way I can keep all this
straight.  It won't fit into my head!

This is an attempt to figure out the heirarchy of forms.pp as it stands
now:

Forms.pp
  Interface 
    Uses 
      controls.pp
        Interface 
          Uses  
            glib.pp - GUI Toolkit Specific (Why is this here?)
            gdk.pp - GUI Toolkit Specific (Why is this here?)
            gtk.pp - GUI Toolkit Specific (Why is this here?)
            sysutils.pp  - No GUI Toolkit specific dependencies
            Classes.pp  - No GUI Toolkit specific dependencies
            vclglobals.pp
              Interface 
                Uses
                  glib.pp - GUI Toolkit Specific (Why is this here?)
                  gdk.pp - GUI Toolkit Specific (Why is this here?)
                  gtk.pp - GUI Toolkit Specific (Why is this here?)
              End vclglobals.pp
            Graphics.pp
              Interface
                Uses
                  sysutils.pp  - No GUI Toolkit specific dependencies
                  classes.pp - No GUI Toolkit specific dependencies
                  vclglobals.pp
                    Interface 
                      Uses
                        glib.pp - GUI Toolkit Specific (Why is this here?)
                        gdk.pp - GUI Toolkit Specific (Why is this here?)
                        gtk.pp - GUI Toolkit Specific (Why is this here?)
                    End vclglobals.pp
              Implementation
                Uses
                  Interfaces.pp
                    Interface
                      Uses
                        GTK - gtk - GUI Toolkit Specific
                        GTK - gdk - GUI Toolkit Specific
                        GTK - glib - GUI Toolkit Specific
                        GTK - gtkint - GUI Toolkit Specific
                        GTK - Controls - Stop drilldown to prevent
recursion
                        QT - messages - ???
                    End interfaces.pp
                  lmessages.pp
                    Interface
                      Uses
                        Classes - No GUI Toolkit specific dependencies
                        vclglobals
                          Interface 
                            Uses
                              glib.pp - GUI Toolkit Specific (Why is this
here?)
                              gdk.pp - GUI Toolkit Specific (Why is this
here?)
                              gtk.pp - GUI Toolkit Specific (Why is this
here?)
                          End vclglobals.pp
                    End lmessages.pp
                  controls.pp - Stop drilldown to prevent recursion
                Includes
                  graphicsobject.inc
                  graphic.inc
                  bitmap.inc
                  pen.inc
                  brush.inc
                  font.inc
                  canvas.inc
              End grphics.pp
            LMessages.pp
            utrace.pp
        Implementation
          Uses
            Interfaces.pp
              Interfaces.pp
                Interface
                  Uses
                    GTK - gtk - GUI Toolkit Specific
                    GTK - gdk - GUI Toolkit Specific
                    GTK - glib - GUI Toolkit Specific
                    GTK - gtkint - GUI Toolkit Specific
                    GTK - Controls - Stop drilldown to prevent recursion
                    QT - messages - ???
                End interfaces.pp
          Includes
            controlsproc.inc
            contolcanvas.inc
            scrolledwindow.inc
            wincontrol.inc
            control.inc
            customcontrol.inc
        End Controls.pp
      vclglobals.pp
        Interface 
          Uses
            glib.pp - GUI Toolkit Specific (Why is this here?)
            gdk.pp - GUI Toolkit Specific (Why is this here?)
            gtk.pp - GUI Toolkit Specific (Why is this here?)
        End vclglobals.pp
      classes.pp - No GUI Toolkit specific dependencies
      sysutils.pp - No GUI Toolkit specific dependencies
      graphics.pp
        Interface
          Uses
            sysutils.pp  - No GUI Toolkit specific dependencies
            classes.pp - No GUI Toolkit specific dependencies
            vclglobals.pp
              Interface 
                Uses
                  glib.pp - GUI Toolkit Specific (Why is this here?)
                  gdk.pp - GUI Toolkit Specific (Why is this here?)
                  gtk.pp - GUI Toolkit Specific (Why is this here?)
              End vclglobals.pp
        Implementation
          Uses
            Interfaces.pp
              Interface
                Uses
                  GTK - gtk - GUI Toolkit Specific
                  GTK - gdk - GUI Toolkit Specific
                  GTK - glib - GUI Toolkit Specific
                  GTK - gtkint - GUI Toolkit Specific
                  GTK - Controls - Stop drilldown to prevent recursion
                  QT - messages - ???
              End interfaces.pp
            lmessages.pp
              Interface
                Uses
                  Classes - No GUI Toolkit specific dependencies
                  vclglobals
                    Interface 
                      Uses
                        glib.pp - GUI Toolkit Specific (Why is this here?)
                        gdk.pp - GUI Toolkit Specific (Why is this here?)
                        gtk.pp - GUI Toolkit Specific (Why is this here?)
                    End vclglobals.pp
              End lmessages.pp
            controls.pp - Stop drilldown to prevent recursion
          Includes
            graphicsobject.inc
            graphic.inc
            bitmap.inc
            pen.inc
            brush.inc
            font.inc
            canvas.inc
        End grphics.pp
      lMessages.pp
        Interface
          Uses
            Classes - No GUI Toolkit specific dependencies
            vclglobals
              Interface 
                Uses
                  glib.pp - GUI Toolkit Specific (Why is this here?)
                  gdk.pp - GUI Toolkit Specific (Why is this here?)
                  gtk.pp - GUI Toolkit Specific (Why is this here?)
              End vclglobals.pp
        End lmessages.pp
  Implementation
    Uses
      interfaces.pp
        Interface
          Uses
            GTK - gtk - GUI Toolkit Specific
            GTK - gdk - GUI Toolkit Specific
            GTK - glib - GUI Toolkit Specific
            GTK - gtkint - GUI Toolkit Specific
            GTK - Controls - Stop drilldown to prevent recursion
            QT - messages - ???
        End interfaces.pp
    Includes
      form.inc
      CustomForm.inc
      application.inc
  End Forms.pp

My first point of confusion comes with controls.pp.  Why are the glib.pp,
gdk.pp and gtk.pp units in the Interface Uses section of this unit?
Doesn't this break the toolkit independence?  The same holds true for
vclglobals.pp.  Are they even used anywhere, or could they be leftovers?

The second area is also in vclglobals.  The csxxxxx (Class Style ???)
constants defined there are, I assume, lazarus specific.  The interface for
each toolkit will have to map these constants to corresponding toolkit
contants, where there is a match.  Is this correct?

Next in the list is the graphics.pp file.  Are all of the colors defined
there meant to be Delphi compatible, and therefore native win32 color
definitions?  Since the gtk color conversion routines in gtkint.pp are
private, a win32 version (WinInt.pp??) will not need an equivalent color
conversion method, correct?

Lastly, in Forms.pp.  I take it that none of the windows concepts of Window
Style (the WS_xxxxxx constants such as WS_POPUP, WS_DLGFRAME, etc.) have
been implemented yet?  I noticed that to get to CreateWindow through the
Win32 tree, you had to go all the way to funcs.inc in the fcl.

In closing, it seems I have answered some of my own questions just by
writing all of this out.  With the exception of the questions about
controls.pp and vclglobals.pp using the gtk lib files without going through
Interfaces.pp, it would seem I can truly let Interfaces.pp handle this, as
long as I can manage without using anything not implemented already in gtk
(such as the WS_xxxx window styles).  It's only a matter of defining the
correct InterfaceObject (no small task, it seems the GTK DLL's are doing a
_lot_ of the work I'll need to do by hand).

I'll get the hang of this someday ;^)

Jeff.






More information about the Lazarus mailing list