trichview.com

trichview.support




Re: Finding which button was selected


Return to index


Author

Message

Sergey Tkachenko

Posted: 02/27/2004 18:12:58


Hi,


TRichView uses tags of inserted components itself.

If you need to associate additional data with the components you can create

your own components, for example


type

  TMyButton = class (TButton)

    private

      FMyValue: Integer;

    published

      property MyValue: Integer read FFMyValue write FFMyValue;

   end;

and use them instead of standard components.


You can add any number of properties of different types. All published

properties will be saved in RVF (do not forget to register this component:

RegisterClass(TMyButton)).


Focused items works only in TRichView (component or hyperlink can be

focused - it's shown with dotted rectangle around them), not in

TRichViewEdit.


In control's OnClick the Sender parameter is the clicked component itself.

Which additional information do you need?


> Hi,

>

> How do I find out which button was selected when I have more than one

button

> component inserted into a richview document?

>

> Setting the 'tag' when creating the button does not seem to work (checking

> the 'Sender' tag property in the click event returns unpredictable

results),

> and I am having no luck with getting 'GetFocusedItem' to provide any

better

> information (in fact, I am getting access violations, so I figure I am

just

> using it incorrectly).

>

> I am trying to centralize my 'button click' code to one procedure (set

with

> the 'OnClick' property of the button when I create them), and then branch

to

> the required code based on the state of the program. This has been working

> fine while I had just one button on any richview page - but is failing

> miserably when I have to have more than one button.

>

> Any help would be most appreciated - even if it means trying a completely

> different direction.

>

>





Powered by ABC Amber Outlook Express Converter