Skip to content

Commit 67cc259

Browse files
author
Joachim Marder
committed
Adapted project to V2.0 (issue #1)
1 parent 5b03fcc commit 67cc259

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

Samples/Medium Level/02 Context Popup/ContextPopup.dproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@
4343
<DCC_Platform>x86</DCC_Platform>
4444
</PropertyGroup>
4545
<PropertyGroup Condition="'$(Base_Win32)'!=''">
46-
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
4746
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
4847
<VerInfo_Locale>1033</VerInfo_Locale>
49-
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
48+
<DCC_Namespace>Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)</DCC_Namespace>
5049
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
5150
</PropertyGroup>
5251
<PropertyGroup Condition="'$(Base_Win64)'!=''">
@@ -56,7 +55,7 @@
5655
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
5756
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
5857
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
59-
<DCC_DebugInformation>false</DCC_DebugInformation>
58+
<DCC_DebugInformation>0</DCC_DebugInformation>
6059
</PropertyGroup>
6160
<PropertyGroup Condition="'$(Cfg_2)'!=''">
6261
<DCC_Optimize>false</DCC_Optimize>

Samples/Medium Level/02 Context Popup/FMain.dfm

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
object FormMain: TFormMain
22
Left = 0
33
Top = 0
4-
Caption = 'Context Popup'
4+
Caption = 'Click one button in ribbon, then right click in form'
55
ClientHeight = 337
66
ClientWidth = 635
77
Color = clBtnFace
@@ -14,4 +14,14 @@ object FormMain: TFormMain
1414
OnContextPopup = FormContextPopup
1515
PixelsPerInch = 96
1616
TextHeight = 13
17+
object Ribbon: TUIRibbon
18+
Left = 0
19+
Top = 0
20+
Width = 635
21+
Height = 117
22+
ResourceName = 'APPLICATION'
23+
OnLoaded = RibbonLoaded
24+
ExplicitLeft = 8
25+
ExplicitTop = 128
26+
end
1727
end

Samples/Medium Level/02 Context Popup/FMain.pas

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,20 @@ interface
44

55
uses
66
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7-
Dialogs, UIRibbonForm, UIRibbonCommands;
7+
Dialogs, UIRibbonCommands, UIRibbon, Vcl.ExtCtrls;
88

99
type
10-
TFormMain = class(TUIRibbonForm)
10+
TFormMain = class(TForm)
11+
Ribbon: TUIRibbon;
1112
procedure FormContextPopup(Sender: TObject; MousePos: TPoint;
1213
var Handled: Boolean);
14+
procedure RibbonLoaded(Sender: TObject);
1315
private
1416
{ Private declarations }
1517
FCurrentContext: Integer;
1618
FCommandContexts: array [0..3] of TUICommandBoolean;
1719
private
1820
procedure ContextToggle(const Args: TUICommandBooleanEventArgs);
19-
strict protected
20-
procedure RibbonLoaded; override;
21-
public
22-
{ Public declarations }
23-
class function RibbonResourceName: String; override;
2421
end;
2522

2623
var
@@ -31,7 +28,7 @@ implementation
3128
{$R *.dfm}
3229

3330
uses
34-
ContextPopupConst;
31+
ContextPopupUI;
3532

3633
{ TFormMain }
3734

@@ -55,7 +52,7 @@ procedure TFormMain.FormContextPopup(Sender: TObject; MousePos: TPoint;
5552
Ribbon.ShowContextPopup(FCurrentContext, P);
5653
end;
5754

58-
procedure TFormMain.RibbonLoaded;
55+
procedure TFormMain.RibbonLoaded(Sender: TObject);
5956
const
6057
CONTEXTS: array [0..3] of Integer = (
6158
IDC_CMD_CONTEXT1, IDC_CMD_CONTEXT2, IDC_CMD_CONTEXT3, IDC_CMD_CONTEXT4);
@@ -77,9 +74,4 @@ procedure TFormMain.RibbonLoaded;
7774
FCommandContexts[0].Checked := True;
7875
end;
7976

80-
class function TFormMain.RibbonResourceName: String;
81-
begin
82-
Result := 'CONTEXTPOPUP';
83-
end;
84-
8577
end.

0 commit comments

Comments
 (0)