Check-in [48ac2f8d76]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added TText instead of TButton's caption, so it can be left-aligned
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 48ac2f8d76d8f9cfb9635f3d22c2f0bf277d8d2f
User & Date: tinus 2013-07-29 17:24:17
Context
2013-11-22
12:22
Changed order of title caption. Turned DB format settings into const. check-in: a9d673b680 user: MCO tags: trunk
2013-07-29
17:24
Added TText instead of TButton's caption, so it can be left-aligned check-in: 48ac2f8d76 user: tinus tags: trunk
15:21
Added gesture (long tap should pop up the relevant control's PopupMenu). check-in: 67c88e0b92 user: MCO tags: trunk
Changes

Changes to ProjectIt/src/F_ActiveProject.fmx.

154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
...
302
303
304
305
306
307
308












309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
...
462
463
464
465
466
467
468











469
470
471
472
473
474
475
      Height = 65.000000000000000000
      Opacity = 0.750000000000000000
      PopupMenu = pumMenu
      Position.X = 8.000000000000000000
      Position.Y = 80.000000000000000000
      Sides = [sdTop, sdLeft, sdBottom, sdRight]
      TabOrder = 1
      Text = 'Project'
      Width = 305.000000000000000000
      XRadius = 15.000000000000000000
      YRadius = 15.000000000000000000
      OnClick = btnProjectClick
      OnMouseDown = ControlDragMouseDown
      object rndrctTime2: TRoundRect
        Fill.Kind = bkGradient
................................................................................
      object efctGlow2: TInnerGlowEffect
        Softness = 0.400000005960464400
        GlowColor = claWhite
        Opacity = 0.899999976158142100
        Trigger = 'IsMouseOver=true'
        Enabled = False
      end












    end
    object btnProject3: TCornerButton
      DisableFocusEffect = True
      Font.Size = 30.000000000000000000
      StyledSettings = [ssFamily, ssFontColor]
      Height = 65.000000000000000000
      Opacity = 0.750000000000000000
      PopupMenu = pumMenu
      Position.X = 8.000000000000000000
      Position.Y = 152.000000000000000000
      Sides = [sdTop, sdLeft, sdBottom, sdRight]
      TabOrder = 2
      Text = 'Project'
      Width = 305.000000000000000000
      XRadius = 15.000000000000000000
      YRadius = 15.000000000000000000
      OnClick = btnProjectClick
      OnMouseDown = ControlDragMouseDown
      object rndrctTime3: TRoundRect
        Fill.Kind = bkGradient
................................................................................
      object efctGlow3: TInnerGlowEffect
        Softness = 0.400000005960464400
        GlowColor = claWhite
        Opacity = 0.899999976158142100
        Trigger = 'IsMouseOver=true'
        Enabled = False
      end











    end
  end
  object pumMenu: TPopupMenu
    Left = 144
    Top = 296
    object mnuViewProjects: TMenuItem
      Action = actViewProjects







<







 







>
>
>
>
>
>
>
>
>
>
>
>












<







 







>
>
>
>
>
>
>
>
>
>
>







154
155
156
157
158
159
160

161
162
163
164
165
166
167
...
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331

332
333
334
335
336
337
338
...
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
      Height = 65.000000000000000000
      Opacity = 0.750000000000000000
      PopupMenu = pumMenu
      Position.X = 8.000000000000000000
      Position.Y = 80.000000000000000000
      Sides = [sdTop, sdLeft, sdBottom, sdRight]
      TabOrder = 1

      Width = 305.000000000000000000
      XRadius = 15.000000000000000000
      YRadius = 15.000000000000000000
      OnClick = btnProjectClick
      OnMouseDown = ControlDragMouseDown
      object rndrctTime2: TRoundRect
        Fill.Kind = bkGradient
................................................................................
      object efctGlow2: TInnerGlowEffect
        Softness = 0.400000005960464400
        GlowColor = claWhite
        Opacity = 0.899999976158142100
        Trigger = 'IsMouseOver=true'
        Enabled = False
      end
      object txtProject2: TText
        Anchors = [akLeft, akTop, akRight, akBottom]
        Color = claBlack
        Font.Size = 30.000000000000000000
        Height = 50.000000000000000000
        HitTest = False
        HorzTextAlign = taLeading
        Position.X = 64.000000000000000000
        Position.Y = 7.000000000000000000
        Text = 'Project'
        Width = 233.000000000000000000
      end
    end
    object btnProject3: TCornerButton
      DisableFocusEffect = True
      Font.Size = 30.000000000000000000
      StyledSettings = [ssFamily, ssFontColor]
      Height = 65.000000000000000000
      Opacity = 0.750000000000000000
      PopupMenu = pumMenu
      Position.X = 8.000000000000000000
      Position.Y = 152.000000000000000000
      Sides = [sdTop, sdLeft, sdBottom, sdRight]
      TabOrder = 2

      Width = 305.000000000000000000
      XRadius = 15.000000000000000000
      YRadius = 15.000000000000000000
      OnClick = btnProjectClick
      OnMouseDown = ControlDragMouseDown
      object rndrctTime3: TRoundRect
        Fill.Kind = bkGradient
................................................................................
      object efctGlow3: TInnerGlowEffect
        Softness = 0.400000005960464400
        GlowColor = claWhite
        Opacity = 0.899999976158142100
        Trigger = 'IsMouseOver=true'
        Enabled = False
      end
      object txtProject3: TText
        Color = claBlack
        Font.Size = 30.000000000000000000
        Height = 50.000000000000000000
        HitTest = False
        HorzTextAlign = taLeading
        Position.X = 64.000000000000000000
        Position.Y = 7.000000000000000000
        Text = 'Project'
        Width = 233.000000000000000000
      end
    end
  end
  object pumMenu: TPopupMenu
    Left = 144
    Top = 296
    object mnuViewProjects: TMenuItem
      Action = actViewProjects

Changes to ProjectIt/src/F_ActiveProject.pas.

33
34
35
36
37
38
39

40

41
42
43
44
45
46
47
...
103
104
105
106
107
108
109

110




111
112
113
114

115
116
117
118
119
120
121
122
123
124
125
126
127
128

129
130
131
132
133
134
135
136
137
138
...
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
    mnuViewProjects: TMenuItem;
    aclProject: TActionList;
    actViewProjects: TAction;
    MenuItem1: TMenuItem;
    mnuFileExit: TMenuItem;
    actFileExit: TFileExit;
    txtProject: TText;

    gmActiveProject: TGestureManager;

    procedure ControlDragMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X,
      Y: Single);
    procedure btnProjectClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure actViewProjectsExecute(Sender: TObject);
    procedure FormGesture(Sender: TObject; const EventInfo: TGestureEventInfo;
      var Handled: Boolean);
................................................................................
end {FindDescendantByClass};

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmActiveProject.SetProjectActive(const Button: TCustomButton; const Active: Boolean);
var
  Shape: TShape;
  Animation: TBitmapAnimation;

begin




  if Active then begin
    Button.Font.Style := [TFontStyle.fsBold];
    Button.Opacity := 1;
    Shape := TShape(FindDescendantByClass(Button, TShape));

    Shape.Fill.Gradient.Color := TAlphaColorRec.Darkgreen;
    Shape.Fill.Gradient.Color1 := TAlphaColorRec.Lightgreen;
    Animation := TBitmapAnimation(FindDescendantByClass(Button, TBitmapAnimation, True));
    if not Animation.Inverse then begin
      Animation.Inverse := True;
      Animation.Enabled := False;
      Animation.Enabled := True;
    end else begin
      (Animation.Parent as TImage).Bitmap.Assign(Animation.StartValue);
    end;
  end else begin
    Button.Font.Style := [];
    Button.Opacity := 0.75;
    Shape := TShape(FindDescendantByClass(Button, TShape));

    Shape.Fill.Gradient.Color := TAlphaColorRec.Blue;
    Shape.Fill.Gradient.Color1 := TAlphaColorRec.DarkBlue;
    Animation := TBitmapAnimation(FindDescendantByClass(Button, TBitmapAnimation, True));
    if Animation.Inverse then begin
      Animation.Inverse := False;
      Animation.Enabled := False;
      Animation.Enabled := True;
    end else begin
      (Animation.Parent as TImage).Bitmap.Assign(Animation.StopValue);
    end;
................................................................................
procedure TfrmActiveProject.btnProjectClick(Sender: TObject);
var
  Button: TCustomButton;
  Child: TFmxObject;
begin
  if Sender is TCustomButton then begin
    Button := TCustomButton(Sender);
    if not (TFontStyle.fsBold in Button.Font.Style) then begin
      SetProjectActive(Button, True);
    end;
  end;

  for Child in lytProjects.Children do begin
    if (Child is TCustomButton) and (Child <> Sender) then begin
      Button := TCustomButton(Child);
      SetProjectActive(Button, False);
    end;
  end;
end;

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmActiveProject.ControlDragMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X,
  Y: Single);
begin
  if (Button = TMouseButton.mbLeft) and (ssAlt in Shift) then begin
    Self.StartWindowDrag;
  end;
end;

end.







>

>







 







>

>
>
>
>

<

<
>


<








<

<
>


<







 







|

|








|








|


33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
...
105
106
107
108
109
110
111
112
113
114
115
116
117
118

119

120
121
122

123
124
125
126
127
128
129
130

131

132
133
134

135
136
137
138
139
140
141
...
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
    mnuViewProjects: TMenuItem;
    aclProject: TActionList;
    actViewProjects: TAction;
    MenuItem1: TMenuItem;
    mnuFileExit: TMenuItem;
    actFileExit: TFileExit;
    txtProject: TText;
    txtProject2: TText;
    gmActiveProject: TGestureManager;
    txtProject3: TText;
    procedure ControlDragMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X,
      Y: Single);
    procedure btnProjectClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure actViewProjectsExecute(Sender: TObject);
    procedure FormGesture(Sender: TObject; const EventInfo: TGestureEventInfo;
      var Handled: Boolean);
................................................................................
end {FindDescendantByClass};

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmActiveProject.SetProjectActive(const Button: TCustomButton; const Active: Boolean);
var
  Shape: TShape;
  Animation: TBitmapAnimation;
  ButtonText: TText;
begin
  ButtonText := TText(FindDescendantByClass(Button, TText));
  Shape := TShape(FindDescendantByClass(Button, TShape));
  Animation := TBitmapAnimation(FindDescendantByClass(Button, TBitmapAnimation, True));

  if Active then begin

    Button.Opacity := 1;

    ButtonText.Font.Style := [TFontStyle.fsBold];
    Shape.Fill.Gradient.Color := TAlphaColorRec.Darkgreen;
    Shape.Fill.Gradient.Color1 := TAlphaColorRec.Lightgreen;

    if not Animation.Inverse then begin
      Animation.Inverse := True;
      Animation.Enabled := False;
      Animation.Enabled := True;
    end else begin
      (Animation.Parent as TImage).Bitmap.Assign(Animation.StartValue);
    end;
  end else begin

    Button.Opacity := 0.75;

    ButtonText.Font.Style := [];
    Shape.Fill.Gradient.Color := TAlphaColorRec.Blue;
    Shape.Fill.Gradient.Color1 := TAlphaColorRec.DarkBlue;

    if Animation.Inverse then begin
      Animation.Inverse := False;
      Animation.Enabled := False;
      Animation.Enabled := True;
    end else begin
      (Animation.Parent as TImage).Bitmap.Assign(Animation.StopValue);
    end;
................................................................................
procedure TfrmActiveProject.btnProjectClick(Sender: TObject);
var
  Button: TCustomButton;
  Child: TFmxObject;
begin
  if Sender is TCustomButton then begin
    Button := TCustomButton(Sender);
//    if not (TFontStyle.fsBold in Button.Font.Style) then begin
      SetProjectActive(Button, True);
//    end;
  end;

  for Child in lytProjects.Children do begin
    if (Child is TCustomButton) and (Child <> Sender) then begin
      Button := TCustomButton(Child);
      SetProjectActive(Button, False);
    end;
  end;
end {TfrmActiveProject.btnProjectClick};

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmActiveProject.ControlDragMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X,
  Y: Single);
begin
  if (Button = TMouseButton.mbLeft) and (ssAlt in Shift) then begin
    Self.StartWindowDrag;
  end;
end {TfrmActiveProject.ControlDragMouseDown};

end.

Changes to ProjectIt/src/F_ActiveProject.vlb.

81
82
83
84
85
86
87







[frmProjectList.srcPrototype]
Coordinates=521,1,150,87

[txtProject]
Coordinates=365,157,61,51














>
>
>
>
>
>
81
82
83
84
85
86
87
88
89
90
91
92
93

[frmProjectList.srcPrototype]
Coordinates=521,1,150,87

[txtProject]
Coordinates=365,157,61,51

[txtProject2]
Coordinates=365,227,67,51

[txtProject3]
Coordinates=316,265,67,51

Changes to ProjectIt/src/prj/ProjectIt.res.

cannot compute difference between binary files