Jump to content


Photo

How to make the entire cell clickable for a TNxCheckboxColumn column?


  • Please log in to reply
8 replies to this topic

#1 Edwin

Edwin
  • Members
  • 43 posts

Posted 16 August 2017 - 02:28 PM

Hello Boki,

 

As per my needs, the checkboxes shown at runtime for a TNxCheckboxColumn column are too small, how to toggle a checkbox even if the mouse is clicking on the blank area of a cell (outside of the checkbox control)?

 

Thanks.



#2 Edwin

Edwin
  • Members
  • 43 posts

Posted 18 August 2017 - 08:07 AM

Any tips boki? Any suggestion would be helpful, thanks!



#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 18 August 2017 - 09:56 PM

Hi,

One thing come to my mind, maybe using OnMouseDown and GetCellAtPos method. Then you can manually switch AsBoolean property of Cell at this position. In v6 there is a icon column who can act like button so you can use very big icon for bigger clickable area.

Try with GetCelllAtPos, it maybe work for you.
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.

#4 Edwin

Edwin
  • Members
  • 43 posts

Posted 19 August 2017 - 05:59 AM

@Boki,

 

Thanks and understand your suggestion.

 

But since I need to apply some business logic with the edit events, I'd prefer another way - to make the checkboxes larger by modifying the TNextGrid source.

 

So I changed the value of the szCheckBox constant in nxDisplays.pas from 11 to 20, but it didn't work. 

 

Am I modifying the wrong thing? Thanks.



#5 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 19 August 2017 - 11:02 AM

Hi,

Maybe also szCheckBoxThemed constant?
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.

#6 Edwin

Edwin
  • Members
  • 43 posts

Posted 19 August 2017 - 12:06 PM

Tried that just now, still doesn't work, any tips?

const
  //szCheckBox = 11;
  szCheckBox = 24; // edwin
  //szCheckBoxThemed = 13;
  szCheckBoxThemed = 24; // edwin


#7 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 19 August 2017 - 12:14 PM

Maybe we also need to update:

function TCheckBoxColumnPlay.GetCheckBoxRect: TRect;
Check this lines:

  if IsStyled then CheckWidth := 16
  else if IsThemed then CheckWidth := 13
  else CheckWidth := 11;

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.

#8 Edwin

Edwin
  • Members
  • 43 posts

Posted 21 August 2017 - 07:29 AM

@Boki,

Changed as following, still not working...

  // edwin
  //  if IsStyled then CheckWidth := 16
  //  else if IsThemed then CheckWidth := 13
  //  else CheckWidth := 11;
  if IsStyled then CheckWidth := szCheckBox
  else if IsThemed then CheckWidth := szCheckBoxThemed
  else CheckWidth := szCheckBox;
  // end edwin


#9 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 21 August 2017 - 05:28 PM

Hm,

Now it puzzles me. Can you tell me which styling you have for the grid (theme, theme off etc.). Or you can send me sample form with checkbox column only (for example).
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