FormExDesktop basics
Previous  Next

These methods properties and events provide compatibility, as far as possible, with Basic4PPC form methods,  properties and events.      

Methods

CancelClose : If called during a Closing event will cancel the closure of the form.

DrawImage(Path AS String) :  Sets the background image of the form. Images are treated slightly differently to a Basic4PPC form. An ImageLayout property (see below) governs how the image is displayed on the form.

Focus : Brings the focus to the form.

New1(form AS Control) : This creates a new extended form that inherits the size and all the controls and menus from a Basic4PPC form built within the IDE. It may subsequently be freely programmatically modified at runtime.

New2(name AS String , text AS String , width AS Int , Height AS Int ) :  Create a new empty form with the Text property set to "text" of the width and height given.

Refresh : Redraws the form.

Show : Displays the form for the first time or if hidden.

The background graphics drawing methods have had to be renamed as a library cannot have the same names as the Basic4PPC methods as these methods are treated specially within Basic4PPC. The library methods have the same names as Basic4PPC but are prefixed by "b" (for background). GetPixel is not implemented nor is forelayer drawing. If you need these then use a normal Basic4PPC form in your application.

Basic4PPC manages drawing on a form differently to a normal Windows Form in order to make things easier for less experienced programmers. When using this library, if you want the results of your drawing commands to survive resizing, you will probably need to place them in the Paint event which is called whenever the form is updated. You might consider using CallSub(StringVar) within the paint event and change the contents of StringVar to point to different drawing subs at run time.

bCircle(x1, y1, radius, color, format) : Same as Circle.

bDrawString(string, fontsize, x1, y1, x2, y2, color ) : Same as DrawString.

bGetImagePixel(x, y, color) : Additional. Returns the colour of a pixel on the FormEx Image (NOT the FormEx background).

bSetPixel(x, y, color) : Additional. Equivalent to but a bit faster than "bLine(x, y, x+1, y+1, color, BF)".

bSetImagePixel(x, y, color) : Additional. Sets a pixel on the FormEx Image (NOT the FormEx background).

bLine(x1, y1, x2, y2, color, format) : Same as Line.

bPolygon (Xarray, Xstart, Yarray, Ystart,count, color, String format) : Same as Polygon.


Properties

Color : Color [I/O] :  Sets or gets the background color of the form - same as BackColor.

Enabled : Boolean [I/O] : Enables or disables the form.

Height : Int  [I/O] : Gets or sets the height of the form.

Image : Bitmap [I/O] : Gets or sets the background image of the form. Images are treated slightly differently to a Basic4PPC form. An ImageLayout property governs how the image is displayed on the form.

ImageLayout : Int  [I/O] : Determines how the background image is displayed on the form. : 0 normal : 1 Tiled : 2 Center : 3 Stretch : 4 Zoom.

KeyChar : Int [I] : Gets the character code of the last key character received by the form in a KeyPress event.

Name : String [I/O] : Gets or sets the name of the form.

Text : String [I/O] : Gets or sets the text for the forms' caption.

Width : Int  [I/O] : Gets or sets the width of the form.


Events

Closing - Similar to to the Basic4PPC Close event but  but named differently as a library cannot have a method and an event of the same name. Different in that once a form is closed it is disposed and cannot be re-shown. To imitate Basic4PPC behavior call CancelClose and then Hide in this event. When the application is closed these forms will close anyway.

KeyPress -: The key is retrieved by getting the KeyChar property (see above) as a library cannot currently return a value.

Showing - Equivalent to the basic4PPC Show event but named differently as a library cannot have a method and an event of the same name.

As a library cannot currently return values mouse events set the forms' MouseX, MouseY, MouseWheel and MouseButton properties which may then be retrieved in a form mouse event.

MouseDown -The MouseButton property only shows the changed button in this event.

MouseMove -The MouseButton property shows the current state of all the buttons in this event.

MouseUp - The MouseButton property only shows the changed button in this event.