Creating own UI buttons

For questions regarding programming in the EViews programming language.

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

Macrodata
Posts: 22
Joined: Tue Aug 02, 2011 5:52 pm

Creating own UI buttons

Postby Macrodata » Thu Aug 04, 2011 3:05 pm

Hi,

really like the Addin functionality particularly when used with programs that have Uidialogs etc.

My question is:

Is it possible (or will it be possible in the future) to specify the names of the buttons that appear at the bottom of each UI request.

The "Yes" "No" "OK" "Cancel" options are good, but it would be great to be able to specify the text on the buttons. For example, I'd like to be able to specfify "next", "back" and "finish" buttons.

I'm using Eviews 7.2 (enterprise)

thanks

Peter

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: Creating own UI buttons

Postby startz » Thu Aug 04, 2011 3:09 pm

Me too.

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

Re: Creating own UI buttons

Postby EViews Gareth » Thu Aug 04, 2011 3:15 pm

I have given some thought to adding custom buttons to @uidialog in the past, but never got too far with it. I'll add it back onto my list of things to think about for EV8.

Off the top of my head, the only thing we could do would be something like:

Code: Select all

!return = @uidialog("button", "buttext", "button", "buttext")
where !return would be equal to 1 if button1 was clicked, 2 if button2 was clicked etc...

If no "button" element is listed in the @uidialog definition, we'll put up a standard OK/Cancel pair, with !return being equal to 0 or -1. Otherwise we don't put up an OK/Cancel, and !return will be whatever button was pressed.

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

Re: Creating own UI buttons

Postby EViews Gareth » Thu Aug 04, 2011 3:42 pm

We'd probably have to make it that custom buttons would act in the same way as an OK, in that all other elements on the dialog would save the values set by the user in the dialog, rather than ignoring them (which is what happens on a cancel).

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: Creating own UI buttons

Postby startz » Thu Aug 04, 2011 3:58 pm

Works for me :D

Macrodata
Posts: 22
Joined: Tue Aug 02, 2011 5:52 pm

Re: Creating own UI buttons

Postby Macrodata » Thu Aug 04, 2011 8:00 pm

Would be great if it made it into EV8

Even better would be if you could have multiple user dialogs open at once in a tab-type setup (a bit like being able to choose between the "Contents", "Index" "Search" and "Favourites" tables in Eviews Help Topics). Then the user could flick between the tabs entering only the bits which were necessary or of interest for the particular thing they were wanting to do.

The only other thing that would also really help (and has been raised in other forum topics) is the ability to create user defined functions.

For example, one we continually use is an AAPC (annual average percentage change) function. This is how our GDP growth rate figures are presented in the media. At the moment we have to do it as @pcy(@movsum(<variable>,4)) when using quarterly data or @pcy(@movsum(<variable>,12)) when using monthly data. If it won't be possible for users to create their own series then it would really help us if (in particular the quarterly version) could be added to the time series functions.

cheers

Peter

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

Re: Creating own UI buttons

Postby EViews Gareth » Thu Aug 04, 2011 9:40 pm

Neither of those are likely to be added. Supporting such complicated dialogs with the simple @ui language would be unworkable. You'd have hundreds of lines of code just to define a single dialog.

With regards to user-functions, you can get a long way with an add-in. It would be relatively trivial to write an add-in that had a syntax along the lines of:

Code: Select all

seriesA.aapc(seriesB)
which would first calculate the AAPC based on seriesB, and store the values into seriesA (which would have had to have been declared before hand).

Alternatively you could write one with a syntax of:

Code: Select all

aapc(seriesB) "seriesA"
which would do the same thing, but could create an output series called seriesA.

There's a fair amount of flexibility in the add-in language. The only downside is that you cannot use them inline - you can't use them as part of an equation specification etc...


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests