diff --git a/components/mbColorLib/OfficeMoreColorsDialog.lfm b/components/mbColorLib/OfficeMoreColorsDialog.lfm index 64546382d..2fac898d9 100644 --- a/components/mbColorLib/OfficeMoreColorsDialog.lfm +++ b/components/mbColorLib/OfficeMoreColorsDialog.lfm @@ -1,61 +1,65 @@ object OfficeMoreColorsWin: TOfficeMoreColorsWin Left = 265 - Height = 310 + Height = 325 Top = 115 - Width = 343 + Width = 355 ActiveControl = OKbtn BorderIcons = [biSystemMenu] Caption = 'More colors...' - ClientHeight = 310 - ClientWidth = 343 + ClientHeight = 325 + ClientWidth = 355 Constraints.MinHeight = 310 Constraints.MinWidth = 340 Font.Color = clWindowText OnCreate = FormCreate OnKeyDown = FormKeyDown OnResize = FormResize + OnShow = FormShow Position = poMainFormCenter LCLVersion = '1.7' object Label4: TLabel AnchorSideLeft.Control = NewSwatch AnchorSideLeft.Side = asrCenter AnchorSideBottom.Control = NewSwatch - Left = 278 + Left = 290 Height = 15 - Top = 77 + Top = 209 Width = 24 Anchors = [akLeft, akBottom] BorderSpacing.Bottom = 4 Caption = 'New' ParentColor = False end - object Label5: TLabel + object LblCurrent: TLabel AnchorSideLeft.Control = OldSwatch AnchorSideLeft.Side = asrCenter AnchorSideTop.Control = OldSwatch AnchorSideTop.Side = asrBottom - Left = 270 + AnchorSideBottom.Control = Owner + AnchorSideBottom.Side = asrBottom + Left = 282 Height = 15 - Top = 163 + Top = 296 Width = 40 - BorderSpacing.Top = 4 + Anchors = [akLeft, akBottom] + BorderSpacing.Bottom = 14 Caption = 'Current' ParentColor = False end object Pages: TPageControl Left = 6 - Height = 290 + Height = 305 Top = 6 - Width = 239 - ActivePage = Standard + Width = 251 + ActivePage = Custom Anchors = [akTop, akLeft, akRight, akBottom] - TabIndex = 0 + TabIndex = 1 TabOrder = 0 OnChange = PagesChange object Standard: TTabSheet Caption = 'Standard' - ClientHeight = 264 - ClientWidth = 231 + ClientHeight = 273 + ClientWidth = 243 object Label2: TLabel Left = 6 Height = 15 @@ -66,10 +70,12 @@ object OfficeMoreColorsWin: TOfficeMoreColorsWin ParentColor = False end object Hexa: THexaColorPicker + AnchorSideTop.Control = Label2 + AnchorSideTop.Side = asrBottom Left = 0 - Height = 237 + Height = 246 Top = 26 - Width = 228 + Width = 240 Anchors = [akTop, akLeft, akRight, akBottom] HintFormat = 'RGB(%r, %g, %b)'#13'Hex: %h' IntensityText = 'Intensity' @@ -81,8 +87,8 @@ object OfficeMoreColorsWin: TOfficeMoreColorsWin end object Custom: TTabSheet Caption = 'Custom' - ClientHeight = 264 - ClientWidth = 231 + ClientHeight = 277 + ClientWidth = 243 ImageIndex = 1 object Label1: TLabel Left = 6 @@ -96,7 +102,7 @@ object OfficeMoreColorsWin: TOfficeMoreColorsWin object Label3: TLabel Left = 6 Height = 15 - Top = 158 + Top = 171 Width = 35 Anchors = [akLeft, akBottom] Caption = '&Picker:' @@ -106,7 +112,7 @@ object OfficeMoreColorsWin: TOfficeMoreColorsWin object LRed: TLabel Left = 6 Height = 15 - Top = 184 + Top = 197 Width = 23 Anchors = [akLeft, akBottom] Caption = '&Red:' @@ -115,7 +121,7 @@ object OfficeMoreColorsWin: TOfficeMoreColorsWin object LGreen: TLabel Left = 6 Height = 15 - Top = 210 + Top = 223 Width = 34 Anchors = [akLeft, akBottom] Caption = '&Green:' @@ -124,7 +130,7 @@ object OfficeMoreColorsWin: TOfficeMoreColorsWin object LBlue: TLabel Left = 6 Height = 15 - Top = 236 + Top = 249 Width = 26 Anchors = [akLeft, akBottom] Caption = '&Blue:' @@ -132,8 +138,8 @@ object OfficeMoreColorsWin: TOfficeMoreColorsWin end object cbColorDisplay: TComboBox Left = 48 - Height = 21 - Top = 156 + Height = 23 + Top = 167 Width = 147 Anchors = [akLeft, akBottom] ItemHeight = 15 @@ -152,7 +158,7 @@ object OfficeMoreColorsWin: TOfficeMoreColorsWin object LHue: TLabel Left = 120 Height = 15 - Top = 184 + Top = 197 Width = 25 Anchors = [akLeft, akBottom] Caption = '&Hue:' @@ -161,7 +167,7 @@ object OfficeMoreColorsWin: TOfficeMoreColorsWin object LSat: TLabel Left = 120 Height = 15 - Top = 210 + Top = 223 Width = 19 Anchors = [akLeft, akBottom] Caption = '&Sat:' @@ -170,26 +176,31 @@ object OfficeMoreColorsWin: TOfficeMoreColorsWin object LLum: TLabel Left = 120 Height = 15 - Top = 236 + Top = 249 Width = 27 Anchors = [akLeft, akBottom] Caption = 'L&um:' ParentColor = False end object PickerNotebook: TNotebook + AnchorSideTop.Control = Label1 + AnchorSideTop.Side = asrBottom Left = 6 - Height = 132 - Top = 22 - Width = 220 + Height = 141 + Top = 26 + Width = 232 PageIndex = 0 Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Top = 4 TabOrder = 0 object nbHSL: TPage object HSL: THSLColorPicker + AnchorSideTop.Side = asrBottom Left = 0 - Height = 132 + Height = 141 Top = 0 - Width = 220 + Width = 232 + SelectedColor = 16315911 HSPickerHintFormat = 'H: %h S: %s'#13'Hex: %hex' LPickerHintFormat = 'Luminance: %l' Align = alClient @@ -249,6 +260,8 @@ object OfficeMoreColorsWin: TOfficeMoreColorsWin Anchors = [akTop, akLeft, akRight] TabOrder = 0 OnChange = ColorPickerChange + Green = 122 + Blue = 122 SelectedColor = 8026879 end object GTrackbar: TGColorPicker @@ -266,6 +279,8 @@ object OfficeMoreColorsWin: TOfficeMoreColorsWin Anchors = [akTop, akLeft, akRight] TabOrder = 1 OnChange = ColorPickerChange + Red = 122 + Blue = 122 SelectedColor = 8060794 end object BTrackbar: TBColorPicker @@ -281,6 +296,8 @@ object OfficeMoreColorsWin: TOfficeMoreColorsWin Anchors = [akTop, akLeft, akRight] TabOrder = 2 OnChange = ColorPickerChange + Green = 122 + Red = 122 SelectedColor = 16743034 end object Label6: TLabel @@ -329,33 +346,42 @@ object OfficeMoreColorsWin: TOfficeMoreColorsWin end end object OKbtn: TButton - Left = 254 + AnchorSideLeft.Control = Cancelbtn + AnchorSideTop.Control = Owner + Left = 266 Height = 23 Top = 6 Width = 73 - Anchors = [akTop, akRight] + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Top = 6 Caption = 'OK' ModalResult = 1 TabOrder = 1 end object Cancelbtn: TButton - Left = 254 + AnchorSideTop.Control = OKbtn + AnchorSideTop.Side = asrBottom + Left = 266 Height = 23 - Top = 36 + Top = 35 Width = 73 Anchors = [akTop, akRight] + BorderSpacing.Top = 6 Cancel = True Caption = 'Cancel' ModalResult = 2 TabOrder = 2 end object NewSwatch: TmbColorPreview - Left = 254 + AnchorSideLeft.Control = Cancelbtn + AnchorSideLeft.Side = asrCenter + AnchorSideBottom.Control = OldSwatch + Left = 266 Height = 32 Hint = 'RGB(255, 255, 255)' - Top = 96 + Top = 228 Width = 73 - Anchors = [akTop, akRight] + Anchors = [akLeft, akBottom] ShowHint = True ParentShowHint = False OnColorChange = NewSwatchColorChange @@ -365,12 +391,13 @@ object OfficeMoreColorsWin: TOfficeMoreColorsWin AnchorSideTop.Side = asrBottom AnchorSideRight.Control = NewSwatch AnchorSideRight.Side = asrBottom - Left = 254 + AnchorSideBottom.Control = LblCurrent + Left = 266 Height = 32 Hint = 'RGB(255, 255, 255)'#13#10'Hex: FFFFFF' - Top = 127 + Top = 260 Width = 73 - Anchors = [akLeft, akRight] + Anchors = [akLeft, akRight, akBottom] ShowHint = True ParentShowHint = False OnColorChange = OldSwatchColorChange diff --git a/components/mbColorLib/OfficeMoreColorsDialog.pas b/components/mbColorLib/OfficeMoreColorsDialog.pas index 7987b4677..d9a09f73f 100644 --- a/components/mbColorLib/OfficeMoreColorsDialog.pas +++ b/components/mbColorLib/OfficeMoreColorsDialog.pas @@ -51,6 +51,7 @@ type NewSwatch: TmbColorPreview; OldSwatch: TmbColorPreview; procedure cbColorDisplayChange(Sender: TObject); + procedure FormShow(Sender: TObject); procedure HSLChange(Sender: TObject); procedure ERedChange(Sender: TObject); procedure EGreenChange(Sender: TObject); @@ -360,6 +361,18 @@ begin {$ENDIF} end; +procedure TOfficeMoreColorsWin.FormShow(Sender: TObject); +var + h: Integer; +begin + OKbtn.AutoSize := true; + h := OKbtn.Height; + OKbtn.AutoSize := false; + OKbtn.Height := h; + OKbtn.Width := Cancelbtn.Width; + CancelBtn.Height := h; +end; + function TOfficeMoreColorsWin.GetHint(c: TColor): string; begin Result := Format('RGB(%u, %u, %u)'#13'Hex: %s', [ diff --git a/components/mbColorLib/examples/fulldemo/main.lfm b/components/mbColorLib/examples/fulldemo/main.lfm index 32b1c0da9..aa862fe4e 100644 --- a/components/mbColorLib/examples/fulldemo/main.lfm +++ b/components/mbColorLib/examples/fulldemo/main.lfm @@ -1,18 +1,17 @@ object Form1: TForm1 Left = 447 - Height = 397 + Height = 406 Top = 197 - Width = 539 + Width = 564 Caption = 'mbColor Lib v2.1 Demo' - ClientHeight = 397 - ClientWidth = 539 + ClientHeight = 406 + ClientWidth = 564 Font.Color = clWindowText OnCreate = FormCreate ShowHint = True LCLVersion = '1.7' - Scaled = True object Label1: TLabel - Left = 416 + Left = 441 Height = 15 Top = 8 Width = 73 @@ -21,7 +20,7 @@ object Form1: TForm1 ParentColor = False end object Label2: TLabel - Left = 416 + Left = 441 Height = 15 Top = 112 Width = 96 @@ -30,7 +29,7 @@ object Form1: TForm1 ParentColor = False end object Label5: TLabel - Left = 416 + Left = 441 Height = 75 Top = 248 Width = 99 @@ -40,24 +39,24 @@ object Form1: TForm1 end object PageControl1: TPageControl Left = 8 - Height = 384 + Height = 393 Top = 6 - Width = 403 - ActivePage = TabSheet2 + Width = 428 + ActivePage = TabSheet1 Anchors = [akTop, akLeft, akRight, akBottom] - TabIndex = 1 + TabIndex = 0 TabOrder = 0 OnChange = PageControl1Change OnMouseMove = PageControl1MouseMove object TabSheet1: TTabSheet Caption = 'HSLColorPicker' - ClientHeight = 356 - ClientWidth = 395 + ClientHeight = 365 + ClientWidth = 420 object HSLColorPicker1: THSLColorPicker Left = 8 - Height = 340 + Height = 349 Top = 8 - Width = 381 + Width = 406 SelectedColor = 3289805 HSPickerHintFormat = 'H: %h S: %s'#13'Hex: #%hex' LPickerHintFormat = 'Luminance: %l' @@ -69,24 +68,27 @@ object Form1: TForm1 end object TabSheet2: TTabSheet Caption = 'HexaColorPicker' - ClientHeight = 356 - ClientWidth = 395 + ClientHeight = 365 + ClientWidth = 420 ImageIndex = 1 object Label4: TLabel + AnchorSideLeft.Control = CheckBox1 + AnchorSideLeft.Side = asrBottom AnchorSideTop.Control = ComboBox1 AnchorSideTop.Side = asrCenter - Left = 112 + Left = 111 Height = 15 - Top = 335 + Top = 344 Width = 40 + BorderSpacing.Left = 24 Caption = 'Marker:' ParentColor = False end object HexaColorPicker1: THexaColorPicker Left = 48 - Height = 324 + Height = 333 Top = 4 - Width = 289 + Width = 314 Anchors = [akTop, akLeft, akRight, akBottom] HintFormat = 'RGB(%r, %g, %b)'#13'Hex: #%hex' IntensityText = 'Intensity' @@ -101,7 +103,7 @@ object Form1: TForm1 AnchorSideTop.Side = asrCenter Left = 4 Height = 19 - Top = 333 + Top = 342 Width = 83 Caption = 'SliderVisible' Checked = True @@ -110,11 +112,14 @@ object Form1: TForm1 TabOrder = 1 end object ComboBox1: TComboBox - Left = 160 + AnchorSideLeft.Control = Label4 + AnchorSideLeft.Side = asrBottom + Left = 159 Height = 23 - Top = 331 - Width = 71 + Top = 340 + Width = 103 Anchors = [akLeft, akBottom] + BorderSpacing.Left = 8 ItemHeight = 15 ItemIndex = 0 Items.Strings = ( @@ -127,13 +132,16 @@ object Form1: TForm1 Text = 'smArrow' end object CheckBox2: TCheckBox + AnchorSideLeft.Control = ComboBox1 + AnchorSideLeft.Side = asrBottom AnchorSideTop.Control = ComboBox1 AnchorSideTop.Side = asrCenter - Left = 256 + Left = 286 Height = 20 - Top = 332 + Top = 341 Width = 101 Anchors = [akTop, akLeft, akBottom] + BorderSpacing.Left = 24 Caption = 'NewArrowStyle' OnClick = CheckBox2Click TabOrder = 3 @@ -141,86 +149,114 @@ object Form1: TForm1 end object TabSheet3: TTabSheet Caption = 'mbColorPalette' - ClientHeight = 356 - ClientWidth = 395 + ClientHeight = 365 + ClientWidth = 420 ImageIndex = 2 - object Label3: TLabel - AnchorSideTop.Control = ComboBox2 + object LblSort: TLabel + AnchorSideLeft.Control = TabSheet3 + AnchorSideTop.Control = CbSortDir AnchorSideTop.Side = asrCenter + AnchorSideBottom.Control = TabSheet3 + AnchorSideBottom.Side = asrBottom Left = 6 Height = 15 - Top = 325 + Top = 338 Width = 24 + Anchors = [akLeft, akBottom] + BorderSpacing.Left = 6 + BorderSpacing.Bottom = 12 Caption = 'Sort:' ParentColor = False end - object Label6: TLabel - AnchorSideTop.Control = ComboBox4 + object LblStyle: TLabel + AnchorSideLeft.Control = CbSortMode + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = CbStyle AnchorSideTop.Side = asrCenter - Left = 224 + Left = 222 Height = 15 - Top = 325 + Top = 338 Width = 28 + BorderSpacing.Left = 8 Caption = 'Style:' ParentColor = False end - object Label7: TLabel - AnchorSideTop.Control = UpDown1 + object LblSize: TLabel + AnchorSideLeft.Control = CbStyle + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = udSize AnchorSideTop.Side = asrCenter - Left = 336 + Left = 331 Height = 15 - Top = 325 + Top = 338 Width = 23 + BorderSpacing.Left = 6 Caption = 'Size:' ParentColor = False end - object Button1: TButton + object BtnBluePalette: TButton + AnchorSideLeft.Control = LblSort + AnchorSideBottom.Control = CbSortDir Left = 6 Height = 25 - Top = 289 - Width = 107 + Top = 301 + Width = 118 Anchors = [akLeft, akBottom] + AutoSize = True + BorderSpacing.Bottom = 8 Caption = 'Generate blue pal' - OnClick = Button1Click + OnClick = BtnBluePaletteClick TabOrder = 0 end - object Button2: TButton - Left = 120 + object BtnGradientPal: TButton + AnchorSideLeft.Control = BtnBluePalette + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = BtnBluePalette + AnchorSideTop.Side = asrCenter + Left = 128 Height = 25 - Top = 289 - Width = 135 - Anchors = [akLeft, akBottom] + Top = 301 + Width = 139 + AutoSize = True + BorderSpacing.Left = 4 Caption = 'Generate gradient pal' - OnClick = Button2Click + OnClick = BtnGradientPalClick TabOrder = 1 end - object Button4: TButton - Left = 262 + object BtnLoadPal: TButton + AnchorSideLeft.Control = BtnGradientPal + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = BtnBluePalette + AnchorSideTop.Side = asrCenter + Left = 271 Height = 25 - Top = 289 - Width = 121 - Anchors = [akLeft, akBottom] + Top = 301 + Width = 139 + AutoSize = True + BorderSpacing.Left = 4 Caption = 'Load palette from file' - OnClick = Button4Click + OnClick = BtnLoadPalClick TabOrder = 2 end object ScrollBox1: TScrollBox + AnchorSideBottom.Control = BtnBluePalette Left = 6 - Height = 274 + Height = 289 Top = 8 - Width = 385 + Width = 410 HorzScrollBar.Page = 75 VertScrollBar.Page = 50 Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Bottom = 4 BorderStyle = bsNone - ClientHeight = 274 - ClientWidth = 385 + ClientHeight = 289 + ClientWidth = 410 TabOrder = 3 object mbColorPalette1: TmbColorPalette Left = 0 - Height = 272 + Height = 287 Top = 0 - Width = 378 + Width = 403 Anchors = [akTop, akLeft, akRight, akBottom] Colors.Strings = ( 'clBlack' @@ -487,29 +523,37 @@ object Form1: TForm1 OnMouseMove = mbColorPalette1MouseMove end end - object ComboBox2: TComboBox + object CbSortDir: TComboBox + AnchorSideLeft.Control = LblSort + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = LblSort + AnchorSideTop.Side = asrCenter Left = 34 Height = 23 - Top = 321 + Top = 334 Width = 87 - Anchors = [akLeft, akBottom] + BorderSpacing.Left = 4 ItemHeight = 15 ItemIndex = 0 Items.Strings = ( 'soAscending' 'soDescending' ) - OnChange = ComboBox2Change + OnChange = CbSortDirChange Style = csDropDownList TabOrder = 4 Text = 'soAscending' end - object ComboBox3: TComboBox + object CbSortMode: TComboBox + AnchorSideLeft.Control = CbSortDir + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = LblSort + AnchorSideTop.Side = asrCenter Left = 127 Height = 23 - Top = 321 + Top = 334 Width = 87 - Anchors = [akLeft, akBottom] + BorderSpacing.Left = 6 ItemHeight = 15 ItemIndex = 7 Items.Strings = ( @@ -532,36 +576,44 @@ object Form1: TForm1 'smCIEa' 'smCIEb' ) - OnChange = ComboBox3Change + OnChange = CbSortModeChange Style = csDropDownList TabOrder = 5 Text = 'smNone' end - object ComboBox4: TComboBox - Left = 256 + object CbStyle: TComboBox + AnchorSideLeft.Control = LblStyle + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = LblSort + AnchorSideTop.Side = asrCenter + Left = 254 Height = 23 - Top = 321 + Top = 334 Width = 71 - Anchors = [akLeft, akBottom] + BorderSpacing.Left = 4 ItemHeight = 15 ItemIndex = 0 Items.Strings = ( 'csDefault' 'csCorel' ) - OnChange = ComboBox4Change + OnChange = CbStyleChange Style = csDropDownList TabOrder = 6 Text = 'csDefault' end - object UpDown1: TUpDown - Left = 364 + object udSize: TUpDown + AnchorSideLeft.Control = LblSize + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = LblSort + AnchorSideTop.Side = asrCenter + Left = 358 Height = 23 - Top = 321 + Top = 334 Width = 15 - Anchors = [akLeft, akBottom] + BorderSpacing.Left = 4 Min = 0 - OnChangingEx = UpDown1ChangingEx + OnChangingEx = udSizeChangingEx Position = 18 TabOrder = 7 Thousands = False @@ -570,14 +622,14 @@ object Form1: TForm1 end object TabSheet4: TTabSheet Caption = 'HSLRingPicker' - ClientHeight = 356 - ClientWidth = 395 + ClientHeight = 365 + ClientWidth = 420 ImageIndex = 3 object HSLRingPicker1: THSLRingPicker Left = 50 - Height = 342 + Height = 351 Top = 6 - Width = 297 + Width = 322 RingPickerHintFormat = 'Hue: %h' SLPickerHintFormat = 'S: %s L: %l'#13'Hex: %hex' Anchors = [akTop, akLeft, akRight, akBottom] @@ -588,14 +640,14 @@ object Form1: TForm1 end object TabSheet5: TTabSheet Caption = 'HSVColorPicker' - ClientHeight = 356 - ClientWidth = 395 + ClientHeight = 365 + ClientWidth = 420 ImageIndex = 4 object HSVColorPicker1: THSVColorPicker Left = 24 - Height = 342 + Height = 351 Top = 6 - Width = 332 + Width = 357 HintFormat = 'H: %h S: %s V: %v'#13'Hex: %hex' Anchors = [akTop, akLeft, akRight, akBottom] TabOrder = 0 @@ -606,8 +658,8 @@ object Form1: TForm1 OnChange = HSVColorPicker1Change end object VColorPicker2: TVColorPicker - Left = 364 - Height = 355 + Left = 389 + Height = 364 Top = 2 Width = 22 HintFormat = 'Value: %v (selected)' @@ -624,14 +676,14 @@ object Form1: TForm1 end object TabSheet6: TTabSheet Caption = 'SLHColorPicker' - ClientHeight = 356 - ClientWidth = 395 + ClientHeight = 365 + ClientWidth = 420 ImageIndex = 5 object SLHColorPicker1: TSLHColorPicker Left = 8 - Height = 344 + Height = 353 Top = 6 - Width = 385 + Width = 410 HPickerHintFormat = 'Hue: %h (selected)' SLPickerHintFormat = 'S: %s L: %l'#13'Hex: %hex' Anchors = [akTop, akLeft, akRight, akBottom] @@ -642,47 +694,72 @@ object Form1: TForm1 end object TabSheet11: TTabSheet Caption = 'Lists && Trees' - ClientHeight = 356 - ClientWidth = 395 + ClientHeight = 365 + ClientWidth = 420 ImageIndex = 10 object mbColorList1: TmbColorList - Left = 200 - Height = 299 - Top = 10 - Width = 183 - Anchors = [akTop, akLeft, akBottom] + AnchorSideLeft.Control = Bevel1 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = TabSheet11 + AnchorSideRight.Control = TabSheet11 + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = Button5 + Left = 214 + Height = 328 + Top = 4 + Width = 202 + Anchors = [akTop, akLeft, akRight, akBottom] TabOrder = 0 end object mbColorTree1: TmbColorTree - Left = 8 - Height = 300 - Top = 10 - Width = 184 + AnchorSideLeft.Control = TabSheet11 + AnchorSideTop.Control = TabSheet11 + AnchorSideRight.Control = Bevel1 + AnchorSideBottom.Control = Button5 + Left = 4 + Height = 328 + Top = 4 + Width = 202 InfoLabelText = 'Color Values:' InfoDisplay1 = 'RGB: %r.%g.%b' InfoDisplay2 = 'HEX: #%hex' - Anchors = [akTop, akLeft, akBottom] + Anchors = [akTop, akLeft, akRight, akBottom] Indent = 51 TabOrder = 1 end object Button5: TButton - Left = 128 + AnchorSideLeft.Control = TabSheet11 + AnchorSideLeft.Side = asrCenter + AnchorSideBottom.Control = TabSheet11 + AnchorSideBottom.Side = asrBottom + Left = 135 Height = 25 - Top = 317 - Width = 137 + Top = 336 + Width = 151 Anchors = [akLeft, akBottom] + AutoSize = True + BorderSpacing.Bottom = 4 Caption = 'Add colors from palette' OnClick = Button5Click TabOrder = 2 end + object Bevel1: TBevel + AnchorSideLeft.Control = TabSheet11 + AnchorSideLeft.Side = asrCenter + Left = 206 + Height = 50 + Top = 72 + Width = 8 + Shape = bsSpacer + end end object TabSheet7: TTabSheet Caption = 'More' - ClientHeight = 356 - ClientWidth = 395 + ClientHeight = 365 + ClientWidth = 420 ImageIndex = 6 object Label9: TLabel - Left = 128 + Left = 136 Height = 15 Top = 8 Width = 113 @@ -693,7 +770,8 @@ object Form1: TForm1 Left = 8 Height = 25 Top = 8 - Width = 104 + Width = 114 + AutoSize = True Caption = 'Pick from screen' TabOrder = 0 ScreenHintFormat = 'RGB(%r, %g, %b)'#13'Hex: %h' @@ -704,30 +782,31 @@ object Form1: TForm1 Left = 8 Height = 25 Top = 40 - Width = 104 - Caption = 'OfficeColorDialog' + Width = 105 + AutoSize = True + Caption = 'OfficeColorDlg' OnClick = OfficeColorDialogButtonClick TabOrder = 1 end object LColorPicker1: TLColorPicker Left = 34 Height = 25 - Top = 245 - Width = 347 + Top = 254 + Width = 372 HintFormat = 'Luminance: %l (selected)' SelectionIndicator = siRect Anchors = [akLeft, akRight, akBottom] TabOrder = 2 Hue = 0 Saturation = 0 - Luminance = 61 - SelectedColor = 4013373 + Luminance = 54 + SelectedColor = 3552822 end object VColorPicker1: TVColorPicker Left = 34 Height = 21 - Top = 213 - Width = 347 + Top = 222 + Width = 372 HintFormat = 'Value: %v (selected)' ArrowPlacement = spBefore NewArrowStyle = True @@ -742,8 +821,8 @@ object Form1: TForm1 object HColorPicker1: THColorPicker Left = 34 Height = 61 - Top = 284 - Width = 347 + Top = 293 + Width = 372 HintFormat = 'Hue: %h (under mouse)' Increment = 5 ArrowPlacement = spBoth @@ -758,7 +837,7 @@ object Form1: TForm1 end object SColorPicker1: TSColorPicker Left = 8 - Height = 275 + Height = 284 Top = 70 Width = 19 HintFormat = 'Saturation: %s (selected)' @@ -774,10 +853,10 @@ object Form1: TForm1 SelectedColor = 11534335 end object Memo1: TMemo - Left = 128 - Height = 171 + Left = 136 + Height = 180 Top = 26 - Width = 253 + Width = 270 Anchors = [akTop, akLeft, akRight, akBottom] Lines.Strings = ( 'The following variables will be replaced in the hint at runtime:' @@ -822,8 +901,8 @@ object Form1: TForm1 end object TabSheet8: TTabSheet Caption = 'Other' - ClientHeight = 356 - ClientWidth = 395 + ClientHeight = 365 + ClientWidth = 420 ImageIndex = 7 object HSColorPicker1: THSColorPicker Left = 6 @@ -839,8 +918,8 @@ object Form1: TForm1 end object SLColorPicker1: TSLColorPicker Left = 224 - Height = 147 - Top = 144 + Height = 130 + Top = 168 Width = 161 SelectedColor = 6579300 HintFormat = 'H: %h S: %s L: %l'#13'Hex: %hex' @@ -853,9 +932,9 @@ object Form1: TForm1 OnChange = SLColorPicker1Change end object HRingPicker1: THRingPicker - Left = 4 + Left = 6 Height = 130 - Top = 164 + Top = 168 Width = 133 HintFormat = 'Hue: %h (selected)' TabOrder = 2 @@ -868,8 +947,8 @@ object Form1: TForm1 end object TabSheet9: TTabSheet Caption = 'Even more' - ClientHeight = 356 - ClientWidth = 395 + ClientHeight = 365 + ClientWidth = 420 ImageIndex = 8 object Label8: TLabel Left = 6 @@ -881,7 +960,7 @@ object Form1: TForm1 end object CColorPicker1: TCColorPicker Left = 4 - Height = 334 + Height = 343 Top = 18 Width = 22 HintFormat = 'Cyan: %c (selected)' @@ -891,7 +970,7 @@ object Form1: TForm1 end object MColorPicker1: TMColorPicker Left = 34 - Height = 334 + Height = 343 Top = 18 Width = 22 HintFormat = 'Magenta: %m (selected)' @@ -902,7 +981,7 @@ object Form1: TForm1 end object YColorPicker1: TYColorPicker Left = 68 - Height = 333 + Height = 342 Top = 19 Width = 31 HintFormat = 'Yellow: %y (selected)' @@ -913,7 +992,7 @@ object Form1: TForm1 end object KColorPicker1: TKColorPicker Left = 120 - Height = 334 + Height = 343 Top = 18 Width = 22 HintFormat = 'Black: %k (selected)' @@ -926,7 +1005,7 @@ object Form1: TForm1 end object RColorPicker1: TRColorPicker Left = 150 - Height = 334 + Height = 343 Top = 18 Width = 22 HintFormat = 'Red: %r (selected)' @@ -940,7 +1019,7 @@ object Form1: TForm1 end object GColorPicker1: TGColorPicker Left = 182 - Height = 334 + Height = 343 Top = 18 Width = 34 HintFormat = 'Green: %g (selected)' @@ -954,7 +1033,7 @@ object Form1: TForm1 end object BColorPicker1: TBColorPicker Left = 224 - Height = 334 + Height = 343 Top = 18 Width = 22 HintFormat = 'Blue: %b (selected)' @@ -1144,7 +1223,7 @@ object Form1: TForm1 end end object sc: TmbColorPreview - Left = 416 + Left = 441 Height = 62 Top = 25 Width = 108 @@ -1152,7 +1231,7 @@ object Form1: TForm1 Anchors = [akTop, akRight] end object uc: TmbColorPreview - Left = 416 + Left = 441 Height = 62 Top = 130 Width = 108 @@ -1160,7 +1239,7 @@ object Form1: TForm1 Anchors = [akTop, akRight] end object tb1: TTrackBar - Left = 416 + Left = 441 Height = 20 Hint = 'Opacity' Top = 90 @@ -1173,7 +1252,7 @@ object Form1: TForm1 TabOrder = 3 end object tb2: TTrackBar - Left = 416 + Left = 441 Height = 20 Top = 196 Width = 108 @@ -1185,7 +1264,7 @@ object Form1: TForm1 TabOrder = 4 end object CbWebSsafe: TCheckBox - Left = 416 + Left = 441 Height = 19 Top = 328 Width = 66 @@ -1195,7 +1274,7 @@ object Form1: TForm1 TabOrder = 6 end object CbSwatchStyle: TCheckBox - Left = 416 + Left = 441 Height = 19 Top = 218 Width = 83 @@ -1205,7 +1284,7 @@ object Form1: TForm1 TabOrder = 5 end object CbShowHints: TCheckBox - Left = 416 + Left = 441 Height = 19 Top = 349 Width = 78 @@ -1217,7 +1296,7 @@ object Form1: TForm1 TabOrder = 7 end object CbEnabled: TCheckBox - Left = 416 + Left = 441 Height = 19 Top = 371 Width = 62 diff --git a/components/mbColorLib/examples/fulldemo/main.pas b/components/mbColorLib/examples/fulldemo/main.pas index 1bee0a0e7..2161df23a 100644 --- a/components/mbColorLib/examples/fulldemo/main.pas +++ b/components/mbColorLib/examples/fulldemo/main.pas @@ -20,6 +20,7 @@ type { TForm1 } TForm1 = class(TForm) + Bevel1: TBevel; CbShowHints: TCheckBox; CbEnabled: TCheckBox; Label10: TLabel; @@ -42,8 +43,8 @@ type Label2: TLabel; HexaColorPicker1: THexaColorPicker; mbColorPalette1: TmbColorPalette; - Button1: TButton; - Button2: TButton; + BtnBluePalette: TButton; + BtnGradientPal: TButton; HSLRingPicker1: THSLRingPicker; TabSheet5: TTabSheet; TabSheet6: TTabSheet; @@ -67,16 +68,16 @@ type Label4: TLabel; CheckBox2: TCheckBox; Label5: TLabel; - Button4: TButton; + BtnLoadPal: TButton; OpenDialog1: TOpenDialog; ScrollBox1: TScrollBox; - Label3: TLabel; - ComboBox2: TComboBox; - ComboBox3: TComboBox; - Label6: TLabel; - ComboBox4: TComboBox; - Label7: TLabel; - UpDown1: TUpDown; + LblSort: TLabel; + CbSortDir: TComboBox; + CbSortMode: TComboBox; + LblStyle: TLabel; + CbStyle: TComboBox; + LblSize: TLabel; + udSize: TUpDown; TabSheet9: TTabSheet; CColorPicker1: TCColorPicker; MColorPicker1: TMColorPicker; @@ -120,8 +121,8 @@ type procedure HexaColorPicker1Change(Sender: TObject); procedure HexaColorPicker1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); - procedure Button1Click(Sender: TObject); - procedure Button2Click(Sender: TObject); + procedure BtnBluePaletteClick(Sender: TObject); + procedure BtnGradientPalClick(Sender: TObject); procedure mbColorPalette1SelColorChange(Sender: TObject); procedure mbColorPalette1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); @@ -145,17 +146,17 @@ type procedure HRingPicker1Change(Sender: TObject); procedure HRingPicker1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); - procedure UpDown1ChangingEx(Sender: TObject; var AllowChange: Boolean; + procedure udSizeChangingEx(Sender: TObject; var AllowChange: Boolean; NewValue: SmallInt; Direction: TUpDownDirection); procedure VColorPicker2Change(Sender: TObject); procedure FormCreate(Sender: TObject); procedure CheckBox1Click(Sender: TObject); procedure ComboBox1Change(Sender: TObject); procedure CheckBox2Click(Sender: TObject); - procedure Button4Click(Sender: TObject); - procedure ComboBox2Change(Sender: TObject); - procedure ComboBox3Change(Sender: TObject); - procedure ComboBox4Change(Sender: TObject); + procedure BtnLoadPalClick(Sender: TObject); + procedure CbSortDirChange(Sender: TObject); + procedure CbSortModeChange(Sender: TObject); + procedure CbStyleChange(Sender: TObject); procedure CbWebSsafeClick(Sender: TObject); procedure Button5Click(Sender: TObject); procedure CbSwatchStyleClick(Sender: TObject); @@ -208,12 +209,12 @@ begin uc.color := hexacolorpicker1.ColorUnderCursor; end; -procedure TForm1.Button1Click(Sender: TObject); +procedure TForm1.BtnBluePaletteClick(Sender: TObject); begin mbColorPalette1.GeneratePalette(clblue); end; -procedure TForm1.Button2Click(Sender: TObject); +procedure TForm1.BtnGradientPalClick(Sender: TObject); begin mbColorpalette1.GenerateGradientPalette([clblue, clred]); end; @@ -362,28 +363,28 @@ begin hexacolorpicker1.NewArrowStyle := checkbox2.checked; end; -procedure TForm1.Button4Click(Sender: TObject); +procedure TForm1.BtnLoadPalClick(Sender: TObject); begin if opendialog1.Execute then mbcolorpalette1.Palette := opendialog1.FileName; end; -procedure TForm1.ComboBox2Change(Sender: TObject); +procedure TForm1.CbSortDirChange(Sender: TObject); begin - mbcolorpalette1.SortOrder := tsortorder(combobox2.itemindex); + mbcolorpalette1.SortOrder := tsortorder(CbSortDir.itemindex); end; -procedure TForm1.ComboBox3Change(Sender: TObject); +procedure TForm1.CbSortModeChange(Sender: TObject); begin - mbcolorpalette1.Sortmode := tsortmode(combobox3.ItemIndex); + mbcolorpalette1.Sortmode := tsortmode(CbSortMode.ItemIndex); end; -procedure TForm1.ComboBox4Change(Sender: TObject); +procedure TForm1.CbStyleChange(Sender: TObject); begin - mbcolorpalette1.CellStyle := tcellstyle(combobox4.ItemIndex); + mbcolorpalette1.CellStyle := tcellstyle(CbStyle.ItemIndex); end; -procedure TForm1.UpDown1ChangingEx(Sender: TObject; var AllowChange: Boolean; +procedure TForm1.udSizeChangingEx(Sender: TObject; var AllowChange: Boolean; NewValue: SmallInt; Direction: TUpDownDirection); begin allowchange := true; diff --git a/components/mbColorLib/mbReg.pas b/components/mbColorLib/mbReg.pas index 7fc0bb2f0..a9a370c1c 100644 --- a/components/mbColorLib/mbReg.pas +++ b/components/mbColorLib/mbReg.pas @@ -17,7 +17,7 @@ uses ActnList, RColorPicker, GColorPicker, BColorPicker, RAxisColorPicker, GAxisColorPicker, BAxisColorPicker, - CColorPicker, YColorPicker, MColorPicker, KColorPicker, + CColorPicker, MColorPicker, YColorPicker, KColorPicker, HRingPicker, HColorPicker, SColorPicker, LColorPicker, VColorPicker, HSColorPicker, HSVColorPicker, HSLColorPicker, HSLRingPicker, @@ -32,7 +32,7 @@ begin RegisterComponents('mbColor Lib', [ TRColorPicker, TGColorPicker, TBColorPicker, TRAxisColorPicker, TGAxisColorPicker, TBAxisColorPicker, - TCColorPicker, TYColorPicker, TMColorPicker, TKColorPicker, + TCColorPicker, TMColorPicker, TYColorPicker, TKColorPicker, THRingPicker, THColorPicker, TSColorPicker, TLColorPicker, TVColorPicker, THSColorPicker, THSVColorPicker, THSLColorPicker, THSLRingPicker,