Jump to content


Photo

Change OutlookBar Color at runtime


  • Please log in to reply
12 replies to this topic

#1 Chee5

Chee5
  • Members
  • 7 posts

Posted 13 October 2007 - 07:53 PM

Hi Boki,

How do I change the color of OutlookBar.Items[x] at runtime?

Thanks,
CM

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 13 October 2007 - 07:57 PM

Hello Cm,

Use next code:

CODE
  NxOutlookBar1.Item[0].Color := clRed;


But first set AdaptiveColors to False;

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 Chee5

Chee5
  • Members
  • 7 posts

Posted 13 October 2007 - 08:10 PM

Thanks Boki. This is really fast and world class support.
I just missed out the AdaptiveColors part.
Can you explain a bit what is the purpose of AdaptiveColor?
Also I want to set it the same color as we manually click the OutlookBar item. Can you tell me what is that color?

Thanks,
CM

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 13 October 2007 - 08:37 PM

Hello Cm,

When AdaptiveColors property is set to True, colors are used from current color scheme (Blue, Black, Silver), and Item's color property is ignored.

If you think about Selection color, it is taken from color's scheme too, but if needed I will add a property SelectionColor.

Reminder: Color scheme may be set with using TNxColorScheme component (Next Suite tab/category in Delphi).

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#5 Chee5

Chee5
  • Members
  • 7 posts

Posted 16 October 2007 - 06:41 AM

Hi Boki,

I have tried TNxColorScheme component but I cannot get it to work the way I wanted.
What I want to do is similar to your OutlookBar in MainDemo.
I want to mimic the OutlookBar behavior as if user has manually click on it (change color from blue to orange color).
I have successfully open the OutlookBar page using ActivePage but I cannot change its OutlookBar color to be selected color.

Thanks,
CM

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 16 October 2007 - 10:20 AM

Hello Chee,

I am not sure that I understand sad.gif

Color of selected item can't be changed at the moment, but I may add property named SelectionColor. This property will work only if property AdaptiveColors = False.

If you can give me more details, this will be great.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#7 Chee5

Chee5
  • Members
  • 7 posts

Posted 16 October 2007 - 11:26 AM

Thank you for your time, Boki.
Here is the details of what I want to do:

My application mimic your MainDemo style where on the left panel I have OutlookBar navigation menu and right panel is the actual page. I have 3 items in my OutlookBar: Customer, Vendor, and System Configuration. When the system detected user first login, the system will open the "Change Password" page under System Configuration OutlookBar. Currently, I managed to open the System Configuration OutlookBar using ActivePage command. But I also want to change System Configuration OutlookBar color to show user this is the current select bar. How to do this? I can use the Items[x].Color you gave earlier, but then what is the color to set as if we click on the OutlookBar manually? When I try your MainDemo, the selected color is Orange color.

Thanks,
Chee

#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 16 October 2007 - 11:34 AM

Hello Chee,

Do you think about setting ItemIndex property?

Setting this property will "activate" button with this index inside OutlookBar. I hope that this helps.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#9 Chee5

Chee5
  • Members
  • 7 posts

Posted 16 October 2007 - 11:51 AM

YES, Boki. This is exactly what I am looking for.
Thanks a lot.

regards,
Chee

#10 Chee5

Chee5
  • Members
  • 7 posts

Posted 16 October 2007 - 01:42 PM

Hi Boki,

Is there something like ItemIndex in NxLinkLabel?
I want to show a LinkLabel in its selected mode (by changing its font color or draw rectangle around the LinkLabel)

Thanks,
Chee

#11 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 16 October 2007 - 06:18 PM

Hello Chee,

Unfortunatelly not. There is a ImageIndex smile.gif , with possibility to change image from ImageList attached to the LinkLabel.

If you need some specific needs, maybe you can describe it in more details to I propose you some other solution.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#12 Chee5

Chee5
  • Members
  • 7 posts

Posted 16 October 2007 - 06:35 PM

OK Boki.
What I want to do is to show user which NxLinkLabel is currently being SELECTED (something like changing LinkLabel font color or drawing rectangle around LinkLabel).

Thank,
Chee

#13 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 16 October 2007 - 07:08 PM

Hello Chee,

This may be done with using standard OnEnter and OnExit events (most every component in delphi have it).

Here is a small example:

CODE
procedure TForm1.NxLinkLabel1Enter(Sender: TObject);
begin
  NxLinkLabel1.Font.Color := clRed;
  NxLinkLabel1.Font.Style := [fsBold, fsItalic];
end;

procedure TForm1.NxLinkLabel1Exit(Sender: TObject);
begin
  NxLinkLabel1.Font.Color := clBtnText;
  NxLinkLabel1.Font.Style := [];
end;


I hope that it helps,

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users