; _______________________________________________________________________________________
;|                                                                                       |
;| ..::FreshLib::..  Free, open source. Licensed under "BSD 2-clause" license."          |
;|_______________________________________________________________________________________|
;
;  Description: TApplication object class.
;
;  Target OS: Any
;
;  Dependencies:
;
;  Notes: TApplication by the idea is the base of GUI application, but the implementation
;         somehow need fixing...
;_________________________________________________________________________________________
module "TApplication library"


; The root object in the application.
; every other object will be child on the TApplication.MainWindow.
; only one instance of TApplication should be created.
;
object TApplication, TObject

  .FMainWindow   dd ?
  .FAccelerators dd ?
  .FOnIdle       dd ?

  param .MainWindow, .FMainWindow, .FMainWindow
  param .Accelerators, .FAccelerators, .FAccelerators
  param .OnIdle, .FOnIdle, .FOnIdle

  method .__create      ; OS dependent create handler.

  method .Create

  method .ProcessIdle   ; calls all TAction idle handlers if any.

endobj



method TApplication.Create
begin
        inherited 0     ; no parent for the application!
        exec    [.self], TApplication:__create
        return
endp




method TApplication.ProcessIdle
begin


        return
endp



include '%TargetOS%/TApplication.asm'


endmodule
