{ææææææææææææææææææææææææææææææææææææææææææ}
{   \\\                                    }
{  -(j)-                                   }
{    /juanca                               }
{    ~                                     }
{$D © ACASA 1989-1992, All rights reserved }
{ææææææææææææææææææææææææææææææææææææææææææ}

{ tCommonDlg object, descendand of tDialog, base to OWL objects that shell Common Dialogs }

UNIT COMONDLG;
{$C MOVEABLE DEMANDLOAD DISCARDABLE}
INTERFACE
  USES
    WINTYPES,
    WOBJECTS,
    COMMDLG;

  CONST
    cn_MaxCString = 255;


  TYPE
    tCString = array[0..cn_MaxCString] of Char;

    pCommonDlg = ^tCommonDlg;
    tCommonDlg = OBJECT ( tDialog )


      CONSTRUCTOR
      init(iparent:PWindowsObject; name :PChar);

      DESTRUCTOR
      done;
        virtual;

      PROCEDURE
      ok(var msg :TMessage);
        virtual
          id_First + id_Ok;

      PROCEDURE
      cancel(var msg :TMessage);
        virtual
          id_First + id_Cancel;

      FUNCTION
      create :Boolean;
        virtual;

      FUNCTION
      execute:Integer;
        virtual;

      FUNCTION
      dlgTitle :PChar;
        virtual;

    END;


{****************************************************************}
IMPLEMENTATION
  USES
    WINPROCS;


      CONSTRUCTOR
      tCommonDlg.
      {}
      init(iparent:PWindowsObject; name :PChar);
        begin
          tDialog.init(iparent, name);
          disableTransfer;
        end;

      DESTRUCTOR
      tCommonDlg.
      {}
      done;
        begin
          tDialog.done
        end;


      PROCEDURE
      tCommonDlg.
      {}
      ok(var msg :TMessage);
        begin
          msg.result := Word(not canClose)
        end;


      PROCEDURE
      tCommonDlg.
      {}
      cancel(var msg :TMessage);
        begin
          msg.result := 0
        end;

      FUNCTION
      tCommonDlg.
      {}
      create :Boolean;
        begin
           abstract
        end;

      FUNCTION
      tCommonDlg.
      {}
      execute:Integer;
        var
          result :Integer;
        begin
          result := commDlgExtendedError;
          if result = 0
          then
            execute := id_Ok
          else
            execute := -result
        end;

      FUNCTION
      tCommonDlg.
      {}
      dlgTitle :PChar;
        begin
          { override this to give the dialog a title different from default}
          dlgTitle := nil
        end;


END.