Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suonentieto Changes #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions jvcl/run/JvCalc.pas
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ TJvCalculatorForm = class(TJvForm)
FDisplayLabel: TLabel;
FPasteItem: TMenuItem;
FParentWnd: HWND;
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure FormKeyPress(Sender: TObject; var Key: Char);
procedure PopupMenuPopup(Sender: TObject);
procedure CopyItemClick(Sender: TObject);
Expand Down Expand Up @@ -307,7 +308,7 @@ function CreateCalcBtn(AParent: TWinControl; AKind: TCalcBtnKind;
const
BtnCaptions: array [cbSgn..cbMC] of string =
('', ',', '/', '*', '-', '+', 'sqrt', '%', '1/x', '=', '<-', 'C',
'MP', 'MS', 'MR', 'MC');
'M+', 'M-', 'MR', 'MC');
begin
Result := TJvCalcButton.CreateKind(AParent, AKind);
with Result do
Expand Down Expand Up @@ -491,6 +492,7 @@ function TJvCalculator.Execute(ParentWnd: HWND): Boolean;
try
Ctl3D := not FFlat;
Caption := Self.Title;
Scaled := True;
TJvCalculatorPanel(FCalcPanel).FMemory := Self.FMemory;
TJvCalculatorPanel(FCalcPanel).UpdateMemoryLabel;
TJvCalculatorPanel(FCalcPanel).FPrecision := Max(2, Self.Precision);
Expand Down Expand Up @@ -554,6 +556,7 @@ constructor TJvCalculatorForm.Create(AOwner: TComponent);
Items: array [0..1] of TMenuItem;
begin
inherited CreateNew(AOwner, 0); // for BCB
Color := clWindow;
BorderIcons := [biSystemMenu];
BorderStyle := bsDialog;
PixelsPerInch := 96;
Expand All @@ -566,7 +569,8 @@ constructor TJvCalculatorForm.Create(AOwner: TComponent);
Position := poOwnerFormCenter;
{$ELSE}
Position := poScreenCenter;
{$ENDIF COMPILER7_UP};
{$ENDIF COMPILER7_UP};
OnKeyDown := FormKeyDown;
OnKeyPress := FormKeyPress;
Items[0] := NewItem(RsCopyItem, scCtrl + VK_INSERT, False, True, CopyItemClick, 0, '');
Items[1] := NewItem(RsPasteItem, scShift + VK_INSERT, False, True, PasteItemClick, 0, '');
Expand All @@ -579,7 +583,7 @@ constructor TJvCalculatorForm.Create(AOwner: TComponent);
begin
Align := alClient;
Parent := Self;
BevelOuter := bvLowered;
BevelOuter := bvNone;
ParentColor := True;
PopupMenu := Popup;
end;
Expand Down Expand Up @@ -676,6 +680,14 @@ procedure TJvCalculatorForm.DisplayChange(Sender: TObject);
TJvCalculator(Owner).DisplayChange;
end;

procedure TJvCalculatorForm.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
inherited;

if (Key = VK_END) or (Key = VK_INSERT) then
ModalResult := mrOK;
end;

procedure TJvCalculatorForm.FormKeyPress(Sender: TObject; var Key: Char);
begin
TJvCalculatorPanel(FCalcPanel).CalcKeyPress(Sender, Key);
Expand Down
11 changes: 7 additions & 4 deletions jvcl/run/JvToolEdit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ interface
function GetOptions(var dwFlag: DWORD): HRESULT; stdcall;
end;
{$EXTERNALSYM IAutoComplete2}

// To avoid ambiguities, we include shldisp.h and define the _di_ interfaces ourselves
{$HPPEMIT '#include "shldisp.h"'}
{$HPPEMIT 'typedef DelphiInterface<IAutoComplete> _di_IAutoComplete;'}
Expand Down Expand Up @@ -1020,7 +1020,7 @@ TJvDateEdit = class(TJvCustomDateEdit)
property DateAutoBetween;
property MinDate;
property MaxDate;
property Align;
property Align;
property Action;
property AutoSelect;
property AutoSize;
Expand Down Expand Up @@ -1999,6 +1999,9 @@ function TJvCustomComboEdit.BtnWidthStored: Boolean;

procedure TJvCustomComboEdit.ButtonClick;
begin
if Assigned(FPopup) then
TJvPopupWindow(FPopup).Font.Assign(Font);

if Assigned(FOnButtonClick) then
FOnButtonClick(Self);

Expand Down Expand Up @@ -4593,7 +4596,7 @@ procedure TJvEditButton.Paint;
DrawState := FState;
if FPopupVisible then
DrawState := rbsDown;

Details.Part := DP_SHOWCALENDARBUTTONRIGHT;

if not Enabled then
Expand Down Expand Up @@ -5418,4 +5421,4 @@ finalization
UnregisterUnitVersion(HInstance);
{$ENDIF UNITVERSIONING}

end.
end.