Browse Source

modal example

Juliette ELSASS 1 year ago
parent
commit
bc8a0f6993
2 changed files with 66 additions and 40 deletions
  1. 50 40
      test/test_bccombobox/umain.lfm
  2. 16 0
      test/test_bccombobox/umain.pas

+ 50 - 40
test/test_bccombobox/umain.lfm

@@ -1,19 +1,18 @@
 object Form1: TForm1
 object Form1: TForm1
   Left = 433
   Left = 433
-  Height = 218
+  Height = 174
   Top = 119
   Top = 119
-  Width = 400
+  Width = 320
   Caption = 'Form1'
   Caption = 'Form1'
-  ClientHeight = 218
-  ClientWidth = 400
-  DesignTimePPI = 120
+  ClientHeight = 174
+  ClientWidth = 320
   OnCreate = FormCreate
   OnCreate = FormCreate
-  LCLVersion = '2.0.2.0'
+  LCLVersion = '3.2.0.0'
   object BCComboBox1: TBCComboBox
   object BCComboBox1: TBCComboBox
-    Left = 10
-    Height = 49
-    Top = 10
-    Width = 184
+    Left = 8
+    Height = 39
+    Top = 8
+    Width = 147
     Items.Strings = (
     Items.Strings = (
       'One'
       'One'
       'Two'
       'Two'
@@ -22,6 +21,7 @@ object Form1: TForm1
     ItemIndex = 0
     ItemIndex = 0
     ArrowSize = 8
     ArrowSize = 8
     ArrowWidth = 16
     ArrowWidth = 16
+    FocusBorderOpacity = 0
     DropDownBorderColor = 4194304
     DropDownBorderColor = 4194304
     DropDownColor = 8405056
     DropDownColor = 8405056
     DropDownFontColor = 16770790
     DropDownFontColor = 16770790
@@ -108,65 +108,75 @@ object Form1: TForm1
     StateNormal.FontEx.Style = [fsBold]
     StateNormal.FontEx.Style = [fsBold]
     StaticButton = False
     StaticButton = False
     OnChange = BCComboBox1Change
     OnChange = BCComboBox1Change
+    TabOrder = 0
   end
   end
   object Label1: TLabel
   object Label1: TLabel
-    Left = 208
-    Height = 22
-    Top = 24
-    Width = 53
+    Left = 166
+    Height = 15
+    Top = 19
+    Width = 41
     Caption = 'Waiting'
     Caption = 'Waiting'
     ParentColor = False
     ParentColor = False
     ParentFont = False
     ParentFont = False
   end
   end
   object Label2: TLabel
   object Label2: TLabel
-    Left = 12
-    Height = 22
-    Top = 82
-    Width = 41
+    Left = 10
+    Height = 15
+    Top = 66
+    Width = 31
     Caption = 'Style :'
     Caption = 'Style :'
     ParentColor = False
     ParentColor = False
     ParentFont = False
     ParentFont = False
   end
   end
   object RadioFlash: TBGRAThemeRadioButton
   object RadioFlash: TBGRAThemeRadioButton
-    Left = 8
-    Height = 22
-    Top = 152
-    Width = 69
+    Left = 6
+    Height = 18
+    Top = 122
+    Width = 55
+    Theme = BGRAColorTheme1
     Caption = 'Flash'
     Caption = 'Flash'
     Checked = False
     Checked = False
-    Theme = BGRAColorTheme1
     OnChange = RadioButtonChange
     OnChange = RadioButtonChange
   end
   end
   object RadioWin7: TBGRAThemeRadioButton
   object RadioWin7: TBGRAThemeRadioButton
-    Left = 8
-    Height = 22
-    Top = 128
-    Width = 66
+    Left = 6
+    Height = 18
+    Top = 102
+    Width = 53
+    Theme = BGRAColorTheme1
     Caption = 'Win7'
     Caption = 'Win7'
     Checked = False
     Checked = False
-    Theme = BGRAColorTheme1
     OnChange = RadioButtonChange
     OnChange = RadioButtonChange
   end
   end
   object RadioCustom: TBGRAThemeRadioButton
   object RadioCustom: TBGRAThemeRadioButton
-    Left = 8
-    Height = 22
-    Top = 176
-    Width = 86
+    Left = 6
+    Height = 18
+    Top = 141
+    Width = 69
+    Theme = BGRAColorTheme1
     Caption = 'Custom'
     Caption = 'Custom'
     Checked = False
     Checked = False
-    Theme = BGRAColorTheme1
     OnChange = RadioButtonChange
     OnChange = RadioButtonChange
   end
   end
   object RadioDefault: TBGRAThemeRadioButton
   object RadioDefault: TBGRAThemeRadioButton
-    Left = 8
-    Height = 22
-    Top = 104
-    Width = 86
+    Left = 6
+    Height = 18
+    Top = 83
+    Width = 69
+    Theme = BGRAColorTheme1
     Caption = 'Default'
     Caption = 'Default'
     Checked = True
     Checked = True
-    Theme = BGRAColorTheme1
     OnChange = RadioButtonChange
     OnChange = RadioButtonChange
   end
   end
+  object Button1: TButton
+    Left = 224
+    Height = 25
+    Top = 134
+    Width = 75
+    Caption = 'Modal...'
+    TabOrder = 5
+    OnClick = Button1Click
+  end
   object BGRAColorTheme1: TBGRAColorTheme
   object BGRAColorTheme1: TBGRAColorTheme
     ColorNormal = clBlack
     ColorNormal = clBlack
     ColorHover = 24576
     ColorHover = 24576
@@ -174,7 +184,7 @@ object Form1: TForm1
     ColorDisabled = clGray
     ColorDisabled = clGray
     ColorFocused = clMoneyGreen
     ColorFocused = clMoneyGreen
     ColorText = clBlack
     ColorText = clBlack
-    left = 240
-    top = 90
+    Left = 192
+    Top = 72
   end
   end
 end
 end

+ 16 - 0
test/test_bccombobox/umain.pas

@@ -15,6 +15,7 @@ type
   TForm1 = class(TForm)
   TForm1 = class(TForm)
     BCComboBox1: TBCComboBox;
     BCComboBox1: TBCComboBox;
     BGRAColorTheme1: TBGRAColorTheme;
     BGRAColorTheme1: TBGRAColorTheme;
+    Button1: TButton;
     Label1: TLabel;
     Label1: TLabel;
     Label2: TLabel;
     Label2: TLabel;
     RadioCustom: TBGRAThemeRadioButton;
     RadioCustom: TBGRAThemeRadioButton;
@@ -22,6 +23,7 @@ type
     RadioWin7: TBGRAThemeRadioButton;
     RadioWin7: TBGRAThemeRadioButton;
     RadioDefault: TBGRAThemeRadioButton;
     RadioDefault: TBGRAThemeRadioButton;
     procedure BCComboBox1Change(Sender: TObject);
     procedure BCComboBox1Change(Sender: TObject);
+    procedure Button1Click(Sender: TObject);
     procedure FormCreate(Sender: TObject);
     procedure FormCreate(Sender: TObject);
     procedure RadioButtonChange(Sender: TObject);
     procedure RadioButtonChange(Sender: TObject);
   private
   private
@@ -61,6 +63,20 @@ begin
   Label1.Caption := 'Changed to '+BCComboBox1.Text;
   Label1.Caption := 'Changed to '+BCComboBox1.Text;
 end;
 end;
 
 
+procedure TForm1.Button1Click(Sender: TObject);
+var f: TForm1;
+begin
+  Hide;
+  f := TForm1.Create(nil);
+  f.Button1.Visible := false;
+  try
+    f.ShowModal;
+  finally
+    f.Free;
+  end;
+  Close;
+end;
+
 procedure TForm1.OnBCComboBoxDrawItem(Control: TWinControl; Index: integer;
 procedure TForm1.OnBCComboBoxDrawItem(Control: TWinControl; Index: integer;
   ARect: TRect; State: TOwnerDrawState);
   ARect: TRect; State: TOwnerDrawState);
 var
 var