Iv just completed a basic GUI "Element" (Think TObject of the GUI world) and as it may be useful to others you can get it below. The GUI Element Class supports children and passes events down to them. To use it you just need to create a new class based on the TGUI_Element and add your own code (as in TWhatever = Class(TGUI_Element) ). The class currently doesn't support keyboard input(Tho it wouldn't be hard to add it).
It has the following events:
OnPreRender - Triggered when PreRender is called
OnRender - Triggered when Render is called
OnParentSizeChanged - Triggered when the parents size changed
OnMouseDown - Triggered on MouseDown
OnMouseUp - Triggered on MouseUp
OnMouseMove - Triggered on MouseMove
Note: All the above events except OnParentSizeChanged are not fired if the component is not visible.
Main Unit
Code:
unit FME_GUI_Unit;
{
Started on 17 June 2009
by Stuart "Stucuk" Carey
Copyright (C) 2009
}
interface
type
//This is effectivly a copy of the TShiftState but in record form
Mitglieder in diesem Forum: 0 Mitglieder und 5 Gäste
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.