Jump to content


Photo

TNxButtonColumn buttons don't look like a button but a simple blue rectangle

button TNxButtonColumn TNextGrid

  • Please log in to reply
4 replies to this topic

#1 ag74

ag74
  • Members
  • 9 posts

Posted 04 November 2013 - 11:54 AM

Hello,

I'm new with the TNextGrid component and I would like to use it in slide mode. I'm working with C++ Builder XE3.
I added a TNxButtonColumn column to display a button but when I run the app the button looks like a simple blue rectangle (see the attached file).
If it possible to make it look like a real button ?

Here's my code.
void __fastcall TMainForm::Button1Click(TObject *Sender)
{
tTranslationGrid->AddRow(1);
tTranslationGrid->Cell[2][0]->AsString = "lll";
}

I also tried to affect the ObjectReference member to a TButton but it doesn't work.
tTranslationGrid->Cell[2][0]->ObjectReference = Button2;

How do I affect the onclick event of this button ?

Thanks for your help.

Attached Files



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 05 November 2013 - 09:08 AM

Hello Sir,

Please note that this column type is column with Button beside EditBox in editing mode.

Version 6 include ToolbarColumn and also IconColumn include Button property for effect you need. Until then, you need to do a custom drawing. Here is a tutorial about this:

http://dn.bergsoft.n...in-nextgrid.htm
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 ag74

ag74
  • Members
  • 9 posts

Posted 05 November 2013 - 10:51 AM

Hello Boki,

Thank you for your prompt reply.

As version 6 is still in beta I won't install it to publish softwares that are downloadable by our customers, I'll wait for it to get stable.

Is-it possible to add any kind of component I want ? I mean, can I add a TPanel or a TBitbtn ?
If I create a component that inherits from TNxCustomColumn, is it possible to add user components ?

Best regards,
Alex.

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 05 November 2013 - 06:04 PM

Hello Alex,

You may inherit TNxCustomColumn, but you will need to again do drawing by yourself.

I strongly suggest that you use custom drawing. You may get nice results very easy. Problem is "hover" effect, so you can not create hover style button when mouse is over cell. But, you may use OnCellClick event to detect clicks. In custom drawing you may use all methods from TCanvas to draw.
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 ag74

ag74
  • Members
  • 9 posts

Posted 07 November 2013 - 06:53 PM

Hello Boki,

Thanks for your answers.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users