Jump to content


Photo

Change of a buttonglyph


  • Please log in to reply
4 replies to this topic

#1 Falcon

Falcon
  • Members
  • 27 posts

Posted 31 May 2019 - 03:34 PM

Hi at all,

i use a buttoncolumn and at runtime there is a need to change a buttonglyph in a single row.

How can i do this?

Thanks in advance

Karl-Heinz



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,827 posts
  • Gender:Male

Posted 31 May 2019 - 09:23 PM

Hi,

 

I believe OnSetCell event of Column can be nice place where you can set your bitmap. This event is used in moment when cell is transferred to the paint method so it's perfect spot for customising column one more time. Hope it helps.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.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 Falcon

Falcon
  • Members
  • 27 posts

Posted 01 June 2019 - 01:12 PM

Hi Boki,

 

thanks for the answer.

 

I don't think you understood what I wanted.

 

In different lines I would like to equip my buttons with different pictures.
Unfortunately I still have no idea how to do that.

 

Do you have an example for me?

Yours sincerely

 

Karl-Heinz



#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,827 posts
  • Gender:Male

Posted 01 June 2019 - 02:05 PM

Hi,

 

Maybe I thought about toolbar column. In case of button column, you can use some of the edit events.

 

‚ÄčI recommend on OnInplaceEditInsert event (see more at: http://developer.ber...683&lang=en-us)

 

There you will access InplaceEdit property of NextGrid and cast it to TNxButtonEdit6 and then simply access ButtonGlyph property and set desired bitmap.

 

In page above you can see how I customised other type of InplaceEdit

procedure TForm1.NextGrid61InplaceEditInsert(Sender: TObject; ACol, ARow: Integer; Component: TComponent);
begin
  if ACol = 1 then
  begin
    with Component as TListBoxEdit do
    begin
      Items.Add('George');
      Items.Add('Lucia');
      Items.Add('Michael');
      Items.Add('Ann');
      Items.Add('Ben');
    end;
  end;
end;

boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.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 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,827 posts
  • Gender:Male

Posted 01 June 2019 - 02:34 PM

Ps. This event already include TComponent parameter that you can simply typecast and mange your editor on Arow.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.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