geraldholdsworth / GJHCustomComponents

A set of custom components and classes for Lazarus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GJHCustomComponents

A set of custom components and classes for Lazarus:

  • TGJHTickBox : RISC OS style tick box
  • TGJHRadioBox : RISC OS style radio (option) box
  • TGJHSlider : Coloured slider with title and value
  • TGJHButton : RISC OS style buttons
  • TGJHRegistry : Wrapper around the TRegistry class
I have written these to serve my own purposes, but are here for others to use. I will likely add to them, and update them over time.
Utilising these means not having to install packages and recompile Lazarus.

Usage

TGJHTickBox and TGJHRadioBox

Methods
Create(AOwner)
Creates the control. Pass the owner control as the only parameter.

Events
OnChange
Fires when the control changes state.

Properties
In addtion to what is inherited from TGraphicControl, including Top, Left, Visible, Parent, Name and Font.
Caption: String
Text displayed next to the box.
Colour: TColor
Background colour. Default: clNone.
Group: Integer
(RadioBox only) Allows controls to be grouped together, and have several different groups of radio controls with the same parent.
OnlyMouse: Boolean
Only fire the OnChange event when clicked on. Default: False.
Ticked: Boolean
Ticked or not. Default: False.

TGJHSlider

Methods
Create(AOwner)
Creates the control. Pass the owner control as the only parameter.

Events
OnChange
Fires when the position changes.

Properties
In addtion to what is inherited from TGraphicControl, including Top, Left, Width, Height, Visible, Parent, Name and Font.
BackColour: TColor
Background colour of the actual slider (not the surrounding area). Has no effect if Transparent is True. Default: clWhite.
Border3D: Boolean
Display a RISC OS style 3D border around the entire control. Default: False.
Caption: String
Text displayed top or right of the slider.
Colour: TColor
Colour of the slider. Default: clRed.
FillSlider: Boolean
Whether to fill the slider or just to the position. Default: False.
Gradient: Boolean
Whether to fade the colour to black at lowest position or a solid colour. Default: False.
HexValue: Boolean
Display the position as hex. Default: False.
Max: Integer
Maximum the position can be. Default: 100.
Min: Integer
Minimum the position can be. Default: 0.
Orientation: Integer
Orientation of the slider - csVertical or csHorizontal. Default: csVertical.
Outline: String
Whether, and where, to display a 2D black border. Does not affect the 3D border settings. Default: csOutOuter.
csOutNone : No borders
csOutInner: Border around the actual slider position
csOutOuter: Border around the actual slider entirity
csOutBoth: Both of the above
Pointers: Boolean
Whether to show pointers either side of the slider. Default: True.
Position: Integer
Position of the slider (i.e., the value). Default: 0.
ShowValue: Boolean
Show the value on the bottom/left of the slider. Default: False.
Step: Integer
Step size between positions. Default: 1.
Suffix: String
Text displayed after the value, if shown.
Transparent: Boolean
Whether the actual slider is transparent or use BackColour. Default: True.

TGJHButton

Methods
Create(AOwner)
Creates the control. Pass the owner control as the only parameter.

Events
OnClick
Fires when the control is clicked on.

Properties
In addtion to what is inherited from TGraphicControl, including Top, Left, Visible, Parent, Name and Font.
Caption: String
Text displayed on the button.
Default: Boolean
Specifys that the button is a default button (has the yellow inset border). Default: False.
ModalResult: TModalResult
Modal result to be passed to the form. Default: mrNone.

TGJHRegistry

This is not a visual control.
Methods
Create(LKey: String)
Creates the instance. Pass the registry key as the only parameter.
DeleteKey(LKey: String)
Deletes the entry from the registry.
DoesKeyExist(V: String): Boolean
Returns whether the registry entry V exists.
GetRegValA(V: String; var D: array of Byte)
Gets an array of bytes from the registry entry held in V and stores it in D.
GetRegValB(V: String; D: Boolean): Boolean
Gets a boolean from the registry entry held in V. If the entry does not exist it is created with a default value held in D.
GetRegValI(V: String; D: Integer): Integer
Gets an integer from the registry entry held in V. If the entry does not exist it is created with a default value held in D.
GetRegValS(V: String; D: String): String
Gets a string from the registry entry held in V. If the entry does not exist it is created with a default value held in D.
SetRegValA(V: String; var D: array of Byte)
Sets an array of bytes held in D in the registry entry held in V.
SetRegValB(V: String; D: Boolean)
Sets a boolean held in D in the registry entry held in V.
SetRegValI(V: String; D: Integer)
Sets an integer held in D in the registry entry held in V.
SetRegValS(V: String; D: String)
Sets a string held in D in the registry entry held in V.

Properties
Key: String
The registry key being used (read only).

About

A set of custom components and classes for Lazarus

License:GNU General Public License v3.0


Languages

Language:Pascal 100.0%