Recent

Author Topic: [SOLVED] SpkToolbar Customizing  (Read 1911 times)

Swirl

  • New Member
  • *
  • Posts: 24
[SOLVED] SpkToolbar Customizing
« on: February 04, 2019, 02:55:26 pm »
Hi

I need to customize SpkToolBar -> Appearance -> Pane -> Style at runtime and I do not know how to set Style to psRectangleEtched.
I read the souces but I am not smart enough to derive a solution. Can anyone help?

Regards
Mike [aka swirl]
« Last Edit: March 03, 2019, 11:53:40 am by Swirl »
Working with Lazarus 2.0.6 - FPC 3.0.4 on Win/Mint/elementaryOS
Playing with Lazarus on macOS 10.14 (Mojave)

howardpc

  • Hero Member
  • *****
  • Posts: 3681
Re: SpkToolbar Customizing
« Reply #1 on: February 04, 2019, 03:31:30 pm »
Code: Pascal  [Select][+][-]
  1. procedure TForm1.StyleBtnClick(Sender: TObject);
  2. begin
  3.   if SpkToolbar1.Appearance.Pane.Style <> psRectangleEtched then
  4.     SpkToolbar1.Appearance.Pane.Style := psRectangleEtched;
  5. end;

Swirl

  • New Member
  • *
  • Posts: 24
Re: SpkToolbar Customizing
« Reply #2 on: February 04, 2019, 07:14:11 pm »
Thx 4 your quick answer.
But sorry - SpkToolbar1.Appearance.Pane.Style := psRectangleEtched; does not work though.
I tried it the same way - without success. Lazarus gives me unit1.pas(41,40) Error: Identifier not found "psRectangleEtched"

The operating system I use ist openSUSE Leap 15.0 (64Bit). spktoolbarpackage.lpk tells me "<Version Minor="1" Release="6"/>"
SpkToolbar was installed via Online-Package-Manager.

Regards
Mike
« Last Edit: February 04, 2019, 07:22:04 pm by Swirl »
Working with Lazarus 2.0.6 - FPC 3.0.4 on Win/Mint/elementaryOS
Playing with Lazarus on macOS 10.14 (Mojave)

wp

  • Hero Member
  • *****
  • Posts: 8307
Re: SpkToolbar Customizing
« Reply #3 on: February 04, 2019, 07:28:59 pm »
You can do it in object inspector (property Appearance > Pane > Style) which knows where the declarations are.

If you want to do it at runtime like howardpc proposed, you must add the unit spkt_Appearance to "uses".
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1025
Re: SpkToolbar Customizing
« Reply #4 on: February 04, 2019, 07:39:49 pm »
I need to customize SpkToolBar -> Appearance -> Pane -> Style at runtime and I do not know how to set Style to psRectangleEtched.
I read the souces but I am not smart enough to derive a solution. Can anyone help?

Code: Pascal  [Select][+][-]
  1. procedure TForm1.StyleBtnClick(Sender: TObject);
  2. begin
  3.   if SpkToolbar1.Appearance.Pane.Style <> psRectangleEtched then
  4.     SpkToolbar1.Appearance.Pane.Style := psRectangleEtched;
  5. end;

Thx 4 your quick answer.
But sorry - SpkToolbar1.Appearance.Pane.Style := psRectangleEtched; does not work though.
I tried it the same way - without success. Lazarus gives me unit1.pas(41,40) Error: Identifier not found "psRectangleEtched"

The operating system I use ist openSUSE Leap 15.0 (64Bit). spktoolbarpackage.lpk tells me "<Version Minor="1" Release="6"/>"
SpkToolbar was installed via Online-Package-Manager.
Just add spkt_Appearance to your uselist:
Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, ..., SpkToolbar, spkt_Tab,
  9.   spkt_Pane, spkt_Buttons, spkt_Checkboxes, spkt_Appearance;
  10.  

Swirl

  • New Member
  • *
  • Posts: 24
Re: SpkToolbar Customizing
« Reply #5 on: February 04, 2019, 07:40:48 pm »
Thanks,

works like a charm now!

Regards
Mike
Working with Lazarus 2.0.6 - FPC 3.0.4 on Win/Mint/elementaryOS
Playing with Lazarus on macOS 10.14 (Mojave)

 

TinyPortal © 2005-2018