Jump to content


Photo

TNxButtonEdit .Click function


  • Please log in to reply
9 replies to this topic

#1 eikcam

eikcam
  • Members
  • 23 posts
  • Gender:Male
  • Location:Sydney, Australia

Posted 23 April 2013 - 09:44 AM

Hi,

How do I simulate a TNxButtonEdit click? I see no function like .Click() or .PerformClick()

Is there a way?

Regards,

Dan.

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 25 April 2013 - 06:38 PM

Hello Dan,

Do you only want to call a event assigned to button click, or to set button in pushed state?

I may add a method for this.
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 eikcam

eikcam
  • Members
  • 23 posts
  • Gender:Male
  • Location:Sydney, Australia

Posted 03 May 2013 - 07:56 AM

Boki,

I would like to be able to call a .Click() method from within code.

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 12 May 2013 - 05:44 AM

Hi,

Will be added.
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 d6user

d6user
  • Members
  • 94 posts

Posted 28 September 2013 - 06:27 PM

hi eikcam,

i was suffering from this also. there is no .onEditClick; but there is an .onButtonclick; only works to activate the button. maybe this will help you get buy until an actual .click; or .onEditClick is added in another release.

TNxButtonEdit.OnButtonclick(sender);

then, if you need to put text in the edit part, just add a .setfocus sometime after.

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 01 October 2013 - 05:33 PM

Hi,

Please sorry for delay. Added it.

Please add next code:

public
  procedure Click; override;

...
procedure TNxCustomEdit.Click;
begin
  inherited Click;
end;

Tell me please how it work.
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 d6user

d6user
  • Members
  • 94 posts

Posted 05 October 2013 - 08:25 AM

no, it did not work, not for me.

in the TForm1, public, i added the

procedure click; override;

and then in the Implementation part, i aded the

procedure TNxCustomEdit.Click;
begin
inherited Click;
end;

where does the code go?

i am using a NxButtonEdit control on my form.

#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 06 October 2013 - 12:30 AM

Hello following code add for TNxCustomEdit class (inside public). We simply made this method public.


public
procedure Click; override;
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 d6user

d6user
  • Members
  • 94 posts

Posted 06 October 2013 - 07:54 PM

ok, so that was my problem.. it doesn't exist in my version of nextgrid suite and i have to create (TNxCustomEdit.click). i am using the NxButtonEdit button control which is located in the Next Editors tab in the delphi 6 ide, and is labled, NxEdit in the uses section.

after some time, i managed to figure things out and get it working:

1 - locate the NxEdit in the used section, and move mouse over it and right-click and select Find Declariation.
2 - when it opens NxEdit, search (ctrl-F) for "TNxCustomEdit = class;"
3 - then, scroll down to its Public section and add "Procedure Click; Override;" to it, like this:

public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure ApplyEditing; virtual;
procedure BeginEditing; virtual;
procedure EndEditing; virtual;
procedure PressKey(Key: TChar);
procedure RefreshPreview;
procedure Click; override;

4 - then, locate by searching (ctrl+F) for "{ TNxCustomEdit }" because that will be the end of that section.
5 - and just before it, add the following code:

procedure TNxCustomEdit.Click;
begin
inherited Click;
end;

{ TNxCustomEdit }

6 - now go back to the unit1 tab in your ide.
7 - locate your NxButtonEdit1 control (or, whatever you renamed it to) and under its Events, you will now see onclick.
8 - recompile all
9 - we are done

to test it, just double-click on the onclick and insert a Beep; and when you select the edit part of the control, it should beep.
to test further, you can add a button elsewhere in your app, and add the line NxButtonEdit1 (or whatever name its called) and double-click it, and enter this into it: NxButtonEdit1.Click; it should now beep.

thanks to boki for the code snippet.

#10 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 08 October 2013 - 01:06 PM

PS. It will be now included in official release.
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.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users