Unit JoeLib

Classes

Functions

AddCharLineToMemo - ----------------------------------------------------------------------------------------
AddStringToRichEdit - ---------------------------------------------------------------------------------------------
AngleTextOut - Assembler

---------------------------------------------------------------------------------------------
AppendFileToFile - ---------------------------------------------------------------------------------------------
AppendTextToFile - ---------------------------------------------------------------------------------------------
BinaryBuf - ---------------------------------------------------------------------------------------------
BinaryBufEx - ---------------------------------------------------------------------------------------------
BlockCRC - ---------------------------------------------------------------------------------------------
BoolBuf - ---------------------------------------------------------------------------------------------
BoolToStr - ---------------------------------------------------------------------------------------------
BoolToStrPad - ---------------------------------------------------------------------------------------------
ByteString - ---------------------------------------------------------------------------------------------
ByteToBinary - ---------------------------------------------------------------------------------------------
ByteToBinaryEx - ---------------------------------------------------------------------------------------------
CenterControl - ---------------------------------------------------------------------------------------------
CenterControlHorizontal - ---------------------------------------------------------------------------------------------
CenterControlHorizontalInParent - ---------------------------------------------------------------------------------------------
CenterControlInParent - ---------------------------------------------------------------------------------------------
CenterControlVertical - ---------------------------------------------------------------------------------------------
CenterControlVerticalInParent - ---------------------------------------------------------------------------------------------
ChildControlSizeToTextFile - ---------------------------------------------------------------------------------------------
ColorBlend - ---------------------------------------------------------------------------------------------
ColorBlendEx - ---------------------------------------------------------------------------------------------
ColorDarken - ---------------------------------------------------------------------------------------------
ColorGray - ---------------------------------------------------------------------------------------------
ColorInvert - ---------------------------------------------------------------------------------------------
ColorLighten - ---------------------------------------------------------------------------------------------
ControlSizeToTextFile - ---------------------------------------------------------------------------------------------
CreateBitmapMask - ---------------------------------------------------------------------------------------------
DisplayBitmap - ---------------------------------------------------------------------------------------------
DoPrintTest - ---------------------------------------------------------------------------------------------
DrawTransparent - ---------------------------------------------------------------------------------------------
Even - ---------------------------------------------------------------------------------------------
FileCRC - ---------------------------------------------------------------------------------------------
FileSize - ---------------------------------------------------------------------------------------------
FindClosestFragInList - ---------------------------------------------------------------------------------------------
FindFirstFragInList - ---------------------------------------------------------------------------------------------
FindLeftmostFragInList - ---------------------------------------------------------------------------------------------
FreeObject - ---------------------------------------------------------------------------------------------
GetBottommostControl - ---------------------------------------------------------------------------------------------
GetBottommostControlPixel - ---------------------------------------------------------------------------------------------
GetClientScreenHeight - ---------------------------------------------------------------------------------------------
GetClientScreenWidth - ---------------------------------------------------------------------------------------------
GetCurrentThreadPriority - ---------------------------------------------------------------------------------------------
GetFileVersion - ---------------------------------------------------------------------------------------------
GetFileVersionEx - ---------------------------------------------------------------------------------------------
GetLeftmostControl - ---------------------------------------------------------------------------------------------
GetLeftmostControlPixel - ---------------------------------------------------------------------------------------------
GetLocalHost - ---------------------------------------------------------------------------------------------
GetName - ---------------------------------------------------------------------------------------------
GetRightmostControl - ---------------------------------------------------------------------------------------------
GetRightmostControlPixel - ---------------------------------------------------------------------------------------------
GetTopmostControl - ---------------------------------------------------------------------------------------------
GetTopmostControlPixel - ---------------------------------------------------------------------------------------------
GetTrayRect - ---------------------------------------------------------------------------------------------
GetUniqueFloatID - ---------------------------------------------------------------------------------------------
GetUniqueStringID - ---------------------------------------------------------------------------------------------
GetUserName - ---------------------------------------------------------------------------------------------
GetValue - ---------------------------------------------------------------------------------------------
HardSleep - ---------------------------------------------------------------------------------------------
HexBuf - ---------------------------------------------------------------------------------------------
IntegerToBinary - ---------------------------------------------------------------------------------------------
IsAlpha - ---------------------------------------------------------------------------------------------
IsAlphaNumeric - ---------------------------------------------------------------------------------------------
IsDark - ---------------------------------------------------------------------------------------------
IsNum - ---------------------------------------------------------------------------------------------
IsNumStr - ---------------------------------------------------------------------------------------------
IsParam - ---------------------------------------------------------------------------------------------
IsPrintable - ---------------------------------------------------------------------------------------------
IsPunct - ---------------------------------------------------------------------------------------------
IsTimeout - ----------------------------------------------------------------------------------------
IsTimeoutEx - ----------------------------------------------------------------------------------------
LargestNameInList - ---------------------------------------------------------------------------------------------
LargestStringInList - ---------------------------------------------------------------------------------------------
LowerChar - ---------------------------------------------------------------------------------------------
MsgBox - ----------------------------------------------------------------------------------------
OldTestBit - ---------------------------------------------------------------------------------------------
OverlayControls - ---------------------------------------------------------------------------------------------
PadIntToStr - ---------------------------------------------------------------------------------------------
PadLeft - ---------------------------------------------------------------------------------------------
PadRight - ---------------------------------------------------------------------------------------------
PadSpace - ---------------------------------------------------------------------------------------------
ReplaceBitmapColor - ---------------------------------------------------------------------------------------------
ScrollBarHeight - ---------------------------------------------------------------------------------------------
ScrollBarWidth - ---------------------------------------------------------------------------------------------
SetBit - ---------------------------------------------------------------------------------------------
SetCurrentThreadPriority - ---------------------------------------------------------------------------------------------
SetTimeout - ----------------------------------------------------------------------------------------
SetTimeoutEx - ----------------------------------------------------------------------------------------
ShowMessage - ----------------------------------------------------------------------------------------
ShutDown - ----------------------------------------------------------------------------------------
SizeRect - ---------------------------------------------------------------------------------------------
SoftSleep - ---------------------------------------------------------------------------------------------
StatusMsg - ----------------------------------------------------------------------------------------
StripChar - ---------------------------------------------------------------------------------------------
SyncScreen - ----------------------------------------------------------------------------------------
TestBit - ---------------------------------------------------------------------------------------------
TintBlueAlphaBitmap - ---------------------------------------------------------------------------------------------
TintBlueGreyBitmap - ---------------------------------------------------------------------------------------------
TintBlueGreyBitmapEx - ---------------------------------------------------------------------------------------------
TintGreyscaleBitmap - ---------------------------------------------------------------------------------------------
UpperChar - ---------------------------------------------------------------------------------------------
WordBuf - ---------------------------------------------------------------------------------------------
WordToBinary - ---------------------------------------------------------------------------------------------

Types

PColorArray24
TColorArray24

Constants

HOUR
MINUTE
MSEC_DAY
MSEC_HOUR
MSEC_MIN
MSEC_SEC
MSEC_WEEK
SEC10
SECOND

Variables


Functions


procedure AddCharLineToMemo(c: Char; memo: TMemo);

----------------------------------------------------------------------------------------

procedure AddStringToRichEdit(const msg: String; TextColor: TColor; RichEdit: TRichEdit);

---------------------------------------------------------------------------------------------

procedure AngleTextOut(CV: TCanvas; const sText: String; x, y, angle: Integer);

Assembler

---------------------------------------------------------------------------------------------


procedure AppendFileToFile(source, destination: TFileName);

---------------------------------------------------------------------------------------------

procedure AppendTextToFile(fileName: TFileName; const msg: String);

---------------------------------------------------------------------------------------------

function BinaryBuf(var buf; size: Integer): String;

---------------------------------------------------------------------------------------------

function BinaryBufEx(var buf; size: Integer; spaced, short: Boolean): String;

---------------------------------------------------------------------------------------------

function BlockCRC(OldCrc: Word; Buf: Pointer; BufSize: Integer): Word;

---------------------------------------------------------------------------------------------

function BoolBuf(var buf; size: Integer): String;

---------------------------------------------------------------------------------------------

function BoolToStr(const value: Boolean): String;

---------------------------------------------------------------------------------------------

function BoolToStrPad(const value: Boolean): String;

---------------------------------------------------------------------------------------------

function ByteString(const s: String): String;

---------------------------------------------------------------------------------------------

function ByteToBinary(b: Byte): String;

---------------------------------------------------------------------------------------------

function ByteToBinaryEx(b: Byte; short: Boolean): String;

---------------------------------------------------------------------------------------------

procedure CenterControl(MobileControl, Anchor: TControl);

---------------------------------------------------------------------------------------------

procedure CenterControlHorizontal(MobileControl, Anchor: TControl);

---------------------------------------------------------------------------------------------

procedure CenterControlHorizontalInParent(Comp: TControl);

---------------------------------------------------------------------------------------------

procedure CenterControlInParent(Comp: TControl);

---------------------------------------------------------------------------------------------

procedure CenterControlVertical(MobileControl, Anchor: TControl);

---------------------------------------------------------------------------------------------

procedure CenterControlVerticalInParent(Comp: TControl);

---------------------------------------------------------------------------------------------

procedure ChildControlSizeToTextFile(Parent: TWinControl; FileName: TFileName);

---------------------------------------------------------------------------------------------

function ColorBlend(const Color1, Color2: TColor; Percentage: Single): TColor;

---------------------------------------------------------------------------------------------

function ColorBlendEx(const R1, G1, B1, R2, G2, B2: Integer; Percentage: Single): TRgbTriple;

---------------------------------------------------------------------------------------------

function ColorDarken(OriginalColor: TColor; Phase: Integer): TColor;

---------------------------------------------------------------------------------------------

function ColorGray(color: TColor): Integer;

---------------------------------------------------------------------------------------------

function ColorInvert(Color: TColor): TColor;

---------------------------------------------------------------------------------------------

function ColorLighten(OriginalColor: TColor; Phase: Integer): TColor;

---------------------------------------------------------------------------------------------

procedure ControlSizeToTextFile(Control: TControl; FileName: TFileName);

---------------------------------------------------------------------------------------------

function CreateBitmapMask(bMap: TBitmap; color: TColor): TBitmap;

---------------------------------------------------------------------------------------------

procedure DisplayBitmap(bMap: TBitmap; time: Integer);

---------------------------------------------------------------------------------------------

procedure DoPrintTest(const pages: Integer);

---------------------------------------------------------------------------------------------

procedure DrawTransparent(x, y: Integer; Canvas: TCanvas; bmp, mask: TBitmap);

---------------------------------------------------------------------------------------------

function Even(i: Integer): Boolean;

---------------------------------------------------------------------------------------------

function FileCRC(const filename: String): Word;

---------------------------------------------------------------------------------------------

function FileSize(const filename: TFileName): Integer;

---------------------------------------------------------------------------------------------

function FindClosestFragInList(list: TStringList; fragment: String): Integer;

---------------------------------------------------------------------------------------------

function FindFirstFragInList(list: TStringList; fragment: String): Integer;

---------------------------------------------------------------------------------------------

function FindLeftmostFragInList(list: TStringList; fragment: String): Integer;

---------------------------------------------------------------------------------------------

function FreeObject(var Thing): Boolean;

---------------------------------------------------------------------------------------------

function GetBottommostControl(Parent: TWinControl): TControl;

---------------------------------------------------------------------------------------------

function GetBottommostControlPixel(Parent: TWinControl): Integer;

---------------------------------------------------------------------------------------------

function GetClientScreenHeight: Integer;

---------------------------------------------------------------------------------------------

function GetClientScreenWidth: Integer;

---------------------------------------------------------------------------------------------

function GetCurrentThreadPriority: Integer;

---------------------------------------------------------------------------------------------

function GetFileVersion: String;

---------------------------------------------------------------------------------------------

function GetFileVersionEx(FileName: String): String;

---------------------------------------------------------------------------------------------

function GetLeftmostControl(Parent: TWinControl): TControl;

---------------------------------------------------------------------------------------------

function GetLeftmostControlPixel(Parent: TWinControl): Integer;

---------------------------------------------------------------------------------------------

function GetLocalHost: string;

---------------------------------------------------------------------------------------------

function GetName(const str: String): String;

---------------------------------------------------------------------------------------------

function GetRightmostControl(Parent: TWinControl): TControl;

---------------------------------------------------------------------------------------------

function GetRightmostControlPixel(Parent: TWinControl): Integer;

---------------------------------------------------------------------------------------------

function GetTopmostControl(Parent: TWinControl): TControl;

---------------------------------------------------------------------------------------------

function GetTopmostControlPixel(Parent: TWinControl): Integer;

---------------------------------------------------------------------------------------------

function GetTrayRect: TRect;

---------------------------------------------------------------------------------------------

function GetUniqueFloatID: Extended;

---------------------------------------------------------------------------------------------

function GetUniqueStringID: String;

---------------------------------------------------------------------------------------------

function GetUserName: String;

---------------------------------------------------------------------------------------------

function GetValue(const str: String): String;

---------------------------------------------------------------------------------------------

procedure HardSleep(msec: Integer);

---------------------------------------------------------------------------------------------

function HexBuf(var buf; size: Integer): String;

---------------------------------------------------------------------------------------------

function IntegerToBinary(i: Integer): String;

---------------------------------------------------------------------------------------------

function IsAlpha(const c: Char): Boolean;

---------------------------------------------------------------------------------------------

function IsAlphaNumeric(const c: Char): Boolean;

---------------------------------------------------------------------------------------------

function IsDark(Color: TColor; adjust: Integer): Boolean;

---------------------------------------------------------------------------------------------

function IsNum(const c: Char): Boolean;

---------------------------------------------------------------------------------------------

function IsNumStr(const s: String): Boolean;

---------------------------------------------------------------------------------------------

function IsParam(const param: String): Boolean;

---------------------------------------------------------------------------------------------

function IsPrintable(const c: Char): Boolean;

---------------------------------------------------------------------------------------------

function IsPunct(const c: Char): Boolean;

---------------------------------------------------------------------------------------------

function IsTimeout: Boolean;

----------------------------------------------------------------------------------------

function IsTimeoutEx(const TimeoutPoint: TDateTime): Boolean;

----------------------------------------------------------------------------------------

function LargestNameInList(list: TStringList): String;

---------------------------------------------------------------------------------------------

function LargestStringInList(list: TStringList): String;

---------------------------------------------------------------------------------------------

function LowerChar(const c: Char): Char;

---------------------------------------------------------------------------------------------

procedure MsgBox(const msg: String);

----------------------------------------------------------------------------------------

function OldTestBit(var p; bit: Word): Boolean;

---------------------------------------------------------------------------------------------

procedure OverlayControls(Comp1, Comp2: TControl; Offset: Integer);

---------------------------------------------------------------------------------------------

function PadIntToStr(const value, vLen: Integer): String;

---------------------------------------------------------------------------------------------

function PadLeft(const str: String; MaxWidth: Integer; PadChar: Char): String;

---------------------------------------------------------------------------------------------

function PadRight(const str: String; MaxWidth: Integer; PadChar: Char): String;

---------------------------------------------------------------------------------------------

function PadSpace(s: String; sLen: Integer): String;

---------------------------------------------------------------------------------------------

procedure ReplaceBitmapColor(bMap: TBitmap; Old, New: TColor);

---------------------------------------------------------------------------------------------

function ScrollBarHeight: Integer;

---------------------------------------------------------------------------------------------

function ScrollBarWidth: Integer;

---------------------------------------------------------------------------------------------

procedure SetBit(pBuffer: Pointer; SizeBytes, BitIndex: Integer; Value: Boolean);

---------------------------------------------------------------------------------------------

function SetCurrentThreadPriority(NewPriority: Integer): Boolean;

---------------------------------------------------------------------------------------------

procedure SetTimeout(const msec_delay: Integer);

----------------------------------------------------------------------------------------

function SetTimeoutEx(msec_delay: Integer): TDateTime;

----------------------------------------------------------------------------------------

procedure ShowMessage(const msg: String);

----------------------------------------------------------------------------------------

procedure ShutDown;

----------------------------------------------------------------------------------------

procedure SizeRect(var r: TRect; RadiusX, RadiusY: Integer);

---------------------------------------------------------------------------------------------

procedure SoftSleep(msec: Integer);

---------------------------------------------------------------------------------------------

procedure StatusMsg(memo: TMemo; msg: String);

----------------------------------------------------------------------------------------

function StripChar(const s: String; const c: Char): String;

---------------------------------------------------------------------------------------------

procedure SyncScreen;

----------------------------------------------------------------------------------------

function TestBit(pBuffer: Pointer; SizeBytes, BitIndex: Integer): Boolean;

---------------------------------------------------------------------------------------------

procedure TintBlueAlphaBitmap(Template, NewMap: TBitmap; Tint, BackColor: TColor);

---------------------------------------------------------------------------------------------

procedure TintBlueGreyBitmap(Template, NewMap: TBitmap; Tint, BackColor: TColor);

---------------------------------------------------------------------------------------------

procedure TintBlueGreyBitmapEx(Template, NewMap: TBitmap; Tint, BackColor: TColor; Masked: Boolean);

---------------------------------------------------------------------------------------------

procedure TintGreyscaleBitmap(greyMap, colorMap: TBitmap; tint: TColor);

---------------------------------------------------------------------------------------------

function UpperChar(const c: Char): Char;

---------------------------------------------------------------------------------------------

function WordBuf(var buf; size: Integer): String;

---------------------------------------------------------------------------------------------

function WordToBinary(w: Word): String;

---------------------------------------------------------------------------------------------

Types


PColorArray24 = ^TColorArray24
10 seconds, TDateTime format
TColorArray24 = packed array [0..5000] of TRgbTriple;

Constants

HOUR = (1 / 24)

ms per week, heh heh.. like I'll ever need this

MINUTE = (HOUR / 60)

hour, TDateTime format

MSEC_DAY = MSEC_HOUR * 24

ms per hour

MSEC_HOUR = MSEC_MIN * 60

ms per min

MSEC_MIN = MSEC_SEC * 60

MSEC_SEC = 1000

MSEC_WEEK = MSEC_DAY * 7

ms per day

SEC10 = (SECOND * 10)

second, TDateTime format

SECOND = (MINUTE / 60)

minute, TDateTime format

Variables