create object that activates a command when being opened/clicked on

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

MartinsFest
Posts: 27
Joined: Tue Dec 13, 2022 4:41 am

Re: create object that activates a command when being opened/clicked on

Postby MartinsFest » Tue Jan 03, 2023 5:42 am

I am able to create several types of user objects where each will link to different documentation. My question is: can I create only one type of user object, but such that I can change the link/path each time I add the object type to my workfile?

See illustration below of how I want it set up:
Only one type of object in column "Type", both are "crosscountryscore", but "example1" and "example2" would link to different scores.
Image

This is how it is currently. Notice I am creating two different types in order to link to different documentation. This is what I want to avoid.
Image

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13318
Joined: Tue Sep 16, 2008 5:38 pm

Re: create object that activates a command when being opened/clicked on

Postby EViews Gareth » Tue Jan 03, 2023 9:27 am

I guess you could use some naming convention, and then in the constructor use _this.@name to parse the name of the object and switch which file gets launched based upon the name. No idea if that will work :D
Follow us on Twitter @IHSEViews

MartinsFest
Posts: 27
Joined: Tue Dec 13, 2022 4:41 am

Re: create object that activates a command when being opened/clicked on

Postby MartinsFest » Wed Jan 04, 2023 5:19 am

Hehe, ok, I'll make an attempt, we will see how it goes. Thanks for your assistance!

MartinsFest
Posts: 27
Joined: Tue Dec 13, 2022 4:41 am

Re: create object that activates a command when being opened/clicked on

Postby MartinsFest » Tue Jan 10, 2023 2:55 am

Hey, Gareth,

Everything now works perfectly. Your tip about naming convention and then using _this.@name worked beautifully when implemented in the "viewscores"-file.

Image

I have a question tho - in the appended image you see I try to close the object after it has spawned the documentation. When I use "_this.@name" it does nothing. In case the spawn-command messed up "_this", I also tried the following which does nothing:

Code: Select all

%closethis = _this.@name
...Executing spawn
close {%closethis}


I am also unsure if this is the right approach because when I use the close-command with explicit object names (example: close kpi or close q6gap), Eviews crashes more often than not.

I just want to keep my program tidy - any tips on making the objects close automatically after the user has opened the documentation?

MartinsFest
Posts: 27
Joined: Tue Dec 13, 2022 4:41 am

Re: create object that activates a command when being opened/clicked on

Postby MartinsFest » Thu Jan 12, 2023 6:00 am

The documentation for creating user objects is difficult to find, do you have any papers or anything documenting how to configure different types of user objects?

Example of what would be useful in this documentation:
- How to set up different definition files
- Examples of how to customize what view the user gets to see when opening a user object (examples: make object show some text, or make the view close immediately after object has been opened)
- If possible, show how to allow customization of existing object types. It would be particularly useful if we could modify equations and models such that it is easier for our users to access the descriptions of underlying variables.

If you do not have documentation at the moment, could you please provide some?


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 38 guests