Home About XPde XPde Tools XPde Themes Components Code Samples Links Tips Ðóññêèé |
Home > Tips > 1
Tips (1)
No you can't. If you want to build Windows applications you'll need to buy Delphi Open Edition. |
|
Kylix Open Edition GPL applications like to adevertise the product used to create them. GUI (X windows) applications display a stay-on-top window for three seconds. To remove the nag screen, without clicking on the nag screen itself, just add the -ns switch as a run parameter. For those of you who are new to Kylix, simply go to the Run menu and select the "Parameters ..." entry. Then inside the Parameters edit box add "-ns". To remove the nag message from console applications, simply remove the {$APPTYPE CONSOLE} message from the project source file. |
|
To call another program from your application you need to use the system function. It calls another process, keeping it until it ends. procedure
TForm1.Button1Click(Sender:TObject); |
|
When distributing your Kylix applications, you may need to determine
the libraries that your application replies on. There is a tool within
Linux called ldd. This tool lists the dependancies for a given application.
We can use this to determine the library requirements/dependancies. [bear@splhcb
hello]# ldd hello |
|
Tip from http://www.kylixforum.de/forum (German language) uses SysUtils;
|
|
Tip from http://www.kylixforum.de/forum (German language) String: MakeString('Text', 50000); FastStringReplace: 16 ms
function StrEqualText(Text: PChar; SearchText: PChar; MaxLen: Integer;
|
|
Tip from http://www.kylixforum.de/forum (German language) Original Text: http://www.efg2.com/Lab/Library/Kylix/MatthiasThoma/KDESystemTray.html uses
procedure
TForm1.FormCreate(Sender: TObject);
Width := 24;
// Icons im KDE-SystemTray sollten 24x24 Pixel groß
sein, //
Mit den nachfolgenden Zeilen wird unser Fenster in den SystemTray eingefügt
|
|
|
|
Tip from http://www.kylixforum.de/forum (German language) uses Qt; ... procedure
TForm1.RotatedText(Cnv: TCanvas; Wkl: Integer; Pxy: TPoint; Txt: string);
|
|
Tip from http://www.codebake.com The following is a routine that will enabled you to remove a particular charater or string from an expression. This is very useful, for example, to remove the $ from a string to convert to a curreny value. Function
Detokenizer(Const Tokens: array of string; Const Expression: String):
String;
ParsedAmountEdt.Text := Detokenizer(['%','$','US','AUD'],AmountEdt.Text); Therefore, if the function finds either '%', '$', 'US' or 'AUD' in the
original string, then the detokenizer will remove these entries.
|
|
Tip from http://www.codebake.com There is often a need to set common properties (e.g. visible or enabled properties) of a group of controls. This is often performed when state information has changed for an application. The procedure below sets the visible state for a series of Controls.
SetVisibleProp([NewBtn,OpenBtn,SaveBtn],UserState
<> usNotAuthorized); This example can be extended to set any properties of the TControl
object. |
|
Tip from http://www.codebake.com The TApplication class has defined a call back event that allows you to handle exceptions if you choose. Simply assign a method to the TApplication.OnException event. To do this, we need to create a method of type TExceptionEvent. unit
Unit1; var implementation procedure
TMainForm.FormCreate(Sender: TObject);
Application.OnException
:= MyExceptionHandler; Procedure
TMainForm.MyExceptionHandler(Sender: TObject; E: Exception); end.
As Stated in the Delphi help file: You will generally override the OnException handler to perform additional or different functionality that is already performed by the default exception handler. For example, the above example logs all errors via a LogException(E.Message) call. It then calls the Application.ShowException(E). Other reasons to override the default exception handler include: Define
a new exception display form, rather than the default exception message
dialog.
|
|