Press any key Posted September 10, 2005 Posted September 10, 2005 The Great Borland Delphi - The True Believers Here's another one! Remember that I can't code! Thanks to all the guys (male & female) that can.. You did parts and I just whacked them in. Aussie GST Calculator does just that! Calculates the Australian Goods and Services Tax that must be added to all end sale products. It's 10% by the way. So, maybe not as useful as 7 & 1/2% or 17 & 1/2%. Ten per cent is easier to work out. But after a night out, may be of some use! Updated from an old version which may have been D2, 3, 4 ,5, I forget, to Delphi 2005. Also, the old version of this and WavEar used the installed component dsFancy Buttons and I removed those. I like the mouse over raised buttons of D2005. The code is below::.. (Unit1.pas)unit Unit1;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls, jpeg, Buttons; Const smAlwaysOnTop = 1000; smSetup = 1001; AlwaysOnTop : Boolean = False;type TForm1 = class(TForm) Edit1: TEdit; Edit2: TEdit; Label1: TLabel; Label2: TLabel; Bevel1: TBevel; Bevel2: TBevel; Bevel3: TBevel; Label4: TLabel; Image1: TImage; SpeedButton1: TSpeedButton; SpeedButton2: TSpeedButton; SpeedButton3: TSpeedButton; SpeedButton4: TSpeedButton; procedure SpeedButton4Click(Sender: TObject); procedure SpeedButton3Click(Sender: TObject); procedure SpeedButton2Click(Sender: TObject); procedure SpeedButton1Click(Sender: TObject); procedure wmHandleMessages(var Msg : TMsg; var Handled : Boolean); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.DFM}Procedure Tform1.wmHandleMessages(var Msg : TMsg; var Handled : Boolean);var CheckedFlag : Word; SystemMenu : Hmenu;begin if Msg.message = WM_SYSCOMMAND then begin if Msg.wParam = smAlwaysOnTop then begin if AlwaysOnTop then begin CheckedFlag := mf_unchecked; SetWindowPos(Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE); end else begin CheckedFlag := mf_checked; SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE); end; SystemMenu := GetSystemMenu( Application.Handle, False ); CheckMenuItem(SystemMenu,smAlwaysOnTop,mf_ByCommand+CheckedFlag); SystemMenu := GetSystemMenu( Form1.Handle, False ); CheckMenuItem(SystemMenu,smAlwaysOnTop,mf_ByCommand+CheckedFlag); end; end;end;procedure TForm1.SpeedButton1Click(Sender: TObject);varsubtot, gst: double;errcode : integer;beginVal(Edit1.Text, subtot, errcode );if errcode <> 0 thenShowMessage('You must enter a number!')elsebegingst := subtot * 0.10;Caption := 'Aussie GST = $' + FloatToStr(gst);Edit2.Text := '$'+ FloatToStr(subtot + gst);end;end;procedure TForm1.SpeedButton2Click(Sender: TObject);beginEdit1.Clear;Edit2.Clear;Caption := 'Aussie GST Calculator';end;procedure TForm1.SpeedButton3Click(Sender: TObject);beginClose;end;procedure TForm1.SpeedButton4Click(Sender: TObject);begin Application.messagebox('Aussie GST Calculator'+#10+'_____________________'+#10+''+#10+'= FREEWARE ='+#10+''+#10+'*always on top '+#10+''+#10+'*Shortcut Keys:- Alt + Underline Letter','Taxing time.. :-)',mb_Ok+mb_IconAsterisk);end;end.Message box seems to work OK here!Program is warehoused at eazyshare.com and to download::..Click Here (aussie_gst_calculator.rar - 234K)*I haven't Packed this or WavEar, however if done, should reduce size by half.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now