Skip to content
/ MUIClass Public

Wrapper to use Amiga MUI Objects with standard Pascal objects

License

Notifications You must be signed in to change notification settings

alb42/MUIClass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MUIClass

Wrapper to use Amiga MUI Objects with standard Pascal objects

Units

Dokumentation created from the docu folder: MUIClass Docu
Binaries (IDE, examples, units) for all Amiga systems: MUIClass Binaries

Unit NameObjects
MUIClass.BaseRootClass, Notify, Application, Family, Semaphore, Dataspace, HSpace, VSpace, HBar, VBar, BarTitle, Timer
MUIClass.AreaArea, Rectangle, Balance, Gauge, Scale, Colorfield, Text, PenDisplay, PopPen, Button
MUIClass.GroupGroup, ListView, Register, Virtgroup, Scrollgroup, Radio, Cycle, Coloradjust, Palette
MUIClass.WindowWindow, AboutMUI
MUIClass.GadgetGadget, String, Prop, Scrollbar
MUIClass.ImageImage, Bitmap, PopButton, Checkmark
MUIClass.ListList, FloatText, VolumeList, DirList
MUIClass.PopstringPopstring, PopObject, PopList, PopASL
MUIClass.MenuMenustrip, Menu, Menuitem
MUIClass.NumericNumeric, Knop, Levelmeter, NumericButton, Slider
MUIClass.TreeTreeView
MUIClass.StringGridStringGrid
MUIClass.DialogFileDialog, FontDialog, ScreenModeDialog
MUIClass.DatytypesDatatypesObject
MUIClass.DrawPanelDrawPanel
MUIClass.DialogFileDialog, FontDialog, ScreenModeDialog

Basic usage

Make a new class for your Window.

type
  TMyWindow = class(TMUIWindow)
  end;
var
  Win: TMyWindow;

In your main routine, create your window class.

Win := TMUIWindow.Create;

Set some properties, for example the window title text.

Win.Title := 'Test Window';

Create some contents for the Window, for example a Button and a Text with some properties.

Text := TMUIText.Create;
Text.Contents := 'Not Clicked';
Button := TMUIButton.Create;
Button.Contents := 'Click me';

Now connect both to the Window by assigning the Parents to the window. The order of Parent assignment defines the order in the Window later. By default the window aligns the Items vertically, one over the other (By setting Win.Horizontal := True; you get them side by side).

Text.Parent := Win;
Button.Parent := Win;

We want also some Action in the Window, create an Event Function inside your Window Class:

type
  TMyWindow = class(TMUIWindow)
    procedure ButtonClick(Sender: TObject);
  end;

procedure TMyWindow.ButtonClick(Sender: TObject);
begin
  Text.Contents := 'Clicked';
end;

The Event should be called when the Button is clicked. Connect it to the OnClick Event.

Button.OnClick := @Win.ButtonClick;

Now everythis is ready to run. We start our created application. (There is no need to create a application object or connect the Windows to the application object, this is done automatically). The application is started with

MUIApp.Run;

MUIApp is a global Application object in MUIClass.Base. It has the usual fields you would expect, like application description, events for iconify and so on. If the main Window is closed the application will terminate. (you can also call MUIApp.Terminate to end the application). When the Application quits it will destroy everything which is connected to MUIApp (also nested through other classes or objects) it will free all MUI objects and Pascal Classes.

MUI objects have several fields which can only be changed before the actual object is created, make sure to set them before you start MUIApp.Run. If you try to set such a field in runtime you will get a warning in the debug log and the value will be ignored.

You can find that complete Source of this example in examples/HelloWorld2.pas

How to Handle other problems like dynamic creation/destruction of Windows other event types an Drawing to a Panel check the examples/TestApp.pas which contains many objects and Event connections.

About

Wrapper to use Amiga MUI Objects with standard Pascal objects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published