Skip to content
Permalink
Browse files

Get back a small right-aligned "Donate" button on the very right edge…

… of the main menu
  • Loading branch information...
ansgarbecker committed Jun 3, 2019
1 parent 19775ef commit fc02134ef8bf09234b40908ec01aadbab5a1628d
Showing with 54 additions and 1 deletion.
  1. +31 −0 source/main.dfm
  2. +23 −1 source/main.pas
@@ -1940,6 +1940,37 @@ object MainForm: TMainForm
Action = actAboutBox
end
end
object MainMenuDonate: TMenuItem
Bitmap.Data = {
36030000424D3603000000000000360000002800000010000000100000000100
18000000000000030000C30E0000C30E00000000000000000000FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FF969082999385EFEEECFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCF0E0FAD3A3F8
C586F8C586F9D3A4FBF1E58D8676CCC9C2A49E92969082F5F4F3FFFFFFFFFFFF
FFFFFFFDF8F2F8C586F6B566F6B25DF8C585F8C485F6B25DF4C58B8C8475867E
6ECFCCC69A9386F7F7F5FFFFFFFFFFFFFEF9F2F7BB70FAD3A4F7B86BFAD9AFF9
CB93F9CB93FAD8AEF5C58B979082F7F7F6DBD9D5A49E92766D5BFFFFFFFFFFFF
F7C381F8C17EF9C88DF7B360F9CB93F8BF79F8BF79F9CB93F5C891979081FAFA
FAEDEDEB8F8879E2E0DCFFFFFFFCEEDDF6B76BF9CB93F7BA6FF8C27FF9CB93F8
BE78F8BE78F9CB93F6CF9F979081E9E8E68E816BE7DFD4FFFFFFFFFFFFF9D2A3
FAD3A3FBDEBBF8BE77FAD9B0FBDEBBF9CB93F9CB93FBDEBBF7DBB9847C6B8F84
70EACCA6F9D7ACFFFFFFFFFFFFF8C587F9CA90F9CB93F7B461F9CA90F9CB93F8
BF78F8BF78F9CB93F9D1A1A58C68EECA9DF9C98EF7C486FFFFFFFFFFFFF8C687
F9CA90F9CB93F7B461F9CA90F9CB93F8BF78F8BF78F9CB93F9CB93F8BF79F9CD
97F9C98EF8C587FFFFFFFFFFFFF9D2A2FAD3A3FBDEBBF8BE77FAD9B0FBDEBBF9
CB93F9CB93FBDEBBFAD7ADF8BE77FBDEBBFAD2A1FAD3A3FFFFFFFFFFFFFCEEDD
F6B86BF9CB93F7BA70F8C27FF9CB93F8BE78F8BE78F9CB93F8C17EF7BA70F9CB
93F6B86BFCF0E0FFFFFFFFFFFFFFFFFFF8C382F8C17DF9C88DF6B35FF9CB93F8
BF79F8BF79F9CB93F6B35FF9C98EF8C17DF8C383FFFFFFFFFFFFFFFFFFFFFFFF
FEF9F2F6B96EFAD4A5F7B86AFAD9B0F9CB93F9CB93FAD8AEF7B86AFAD4A5F7BA
70FFFAF4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF9F2F8C585F6B565F6B25DF8
C586F8C586F6B25DF5B565F7C485FEF9F2FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFCEEDCF9D3A3F8C586F8C586F9D2A3FCEEDDFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF}
Caption = 'Donate'
OnClick = DonateClick
end
end
object ActionList1: TActionList
Images = VirtualImageListMain
@@ -648,6 +648,7 @@ TMainForm = class(TForm)
filterQueryHelpers: TButtonedEdit;
TimerStoreTabs: TTimer;
Duplicaterowwithkeys1: TMenuItem;
MainMenuDonate: TMenuItem;
procedure actCreateDBObjectExecute(Sender: TObject);
procedure menuConnectionsPopup(Sender: TObject);
procedure actExitApplicationExecute(Sender: TObject);
@@ -1620,6 +1621,9 @@ procedure TMainForm.FormCreate(Sender: TObject);
OldSnippetsDir, CurrentSnippetsDir, TargetSnippet: String;
Files: TStringDynArray;
dti: TDBDatatypeCategoryIndex;
mii: TMenuItemInfo;
MainMenu: hMenu;
Buffer: array[0..79] of Char;
begin
caption := APPNAME;

@@ -1650,6 +1654,20 @@ procedure TMainForm.FormCreate(Sender: TObject);
ToolBarMainButtons.ShowCaptions := true;
end;


// Right aligned donate button
// GET Help Menu Item Info
MainMenu := GetMenu(Handle);
mii.cbSize := SizeOf(mii) ;
mii.fMask := MIIM_TYPE;
mii.dwTypeData := Buffer;
mii.cch := SizeOf(Buffer) ;
GetMenuItemInfo(MainMenu, MainMenuDonate.Command, false, mii) ;
// SET Help Menu Item Info
mii.fType := mii.fType or MFT_RIGHTJUSTIFY;
SetMenuItemInfo(MainMenu, MainMenuDonate.Command, false, mii) ;
DrawMenuBar(Handle);

// Translate menu items
menuQueryHelpersGenerateSelect.Caption := f_('Generate %s ...', ['SELECT']);
menuQueryHelpersGenerateInsert.Caption := f_('Generate %s ...', ['INSERT']);
@@ -2734,7 +2752,11 @@ procedure TMainForm.DonateClick(Sender: TObject);
place: String;
begin
// Click on one of the various donate buttons
Dialog := GetParentFormOrFrame(TWinControl(Sender));
if Sender is TWinControl then begin
Dialog := GetParentFormOrFrame(TWinControl(Sender));
end else begin
Dialog := Self;
end;
if Dialog = nil then
ErrorDialog(f_('Could not determine parent form of this %s', [Sender.ClassName]))
else begin

0 comments on commit fc02134

Please sign in to comment.
You can’t perform that action at this time.