{&window-name}:show-in-toolbar

I have recently ported a V8 app to 9 and want to apply the {&WINDOW-NAME}:SHOW-IN-TOOLBAR attribute to a whole heap of existing procs.

As this attribute needs to be set before window realisation I'm sort of stuck as to how/where to do this programatically.

So I'm faced with hours of opening/closing/toggling window option/saving unless someone can suggest a smart way to do this (a search-and-replace perhaps?)

Cheers.
 
I presume you mean SHOW-IN-TASKBAR.

I wouldn't generally advise doing a mass search/replace except in the simplest situations, particularly if your file is AppBuilder (I can't remember the V8 name) generated.

Anyway, you can do this with procedure files by some advanced grepping, but why not just write a 4GL routine?

You can IMPORT UNFORMATTED a line at a time, and when you reach your 'CREATE window ... ASSIGN ... ' statement(s), insert directly afterwards a 'SHOW-IN-TASKBAR = FALSE' line.

Will be slow (probably an overnight batch job), but should work ok.
Remember to compile en masse afterwards to check it went ok.

But you won't know until runtime whether or not it really worked, which is why you should really do this via Appbuilder if possible, or automate a run script as well. Of course, by the time you've done all this you could probably have edited them all manually.

Backup first!

Lee

ps. You do realise SHOW-IN-TASKBAR defaults to TRUE - and how are you going to know on the fly which ones you want in the taskbar, unless you want them all?
 
You could ask Progress for a SESSION:SHOW-IN-TASKBAR attribute. :awink:

Apart from that maybe there's an API call you could use, but I don't know.
 

joey.jeremiah

ProgressTalk Moderator
Staff member
Never done that, I mean I wasn't using the UIB back in version 8. I have a Progress v8 copy in my collection. But I didn't get the same problem ?

Like Lee Curzon already mentioned if you edit or change the AppBuilder file directly you run the risk of corrupting the file. Personally it's not something I would try or I'd use it as a last resort.

If it's a SmartWindow you can extend the container class to activate the attribute when the object is initialized. But that would also be an ugly patch that will have nothing to do with the other program you write.

There's probably another way or trick to do that, maybe you should also bring it up @PEG.

One thing you could try is synthesizing keystrokes and mouse clicks through windows API's as if you were doing the changes yourself by hand. You can find examples @ Jurjen Dijkstra - global-shared.com
 

joey.jeremiah

ProgressTalk Moderator
Staff member
I'd be interested in starting a discussion for writing an open source tool that will interact and synthesize key strokes and mouse clicks with and to a session.

Sort of a mechanical typist, maybe typist for short ? anyone interested in taking it further ?
 

Casper

ProgressTalk.com Moderator
Staff member
Hi,

I have recently ported a V8 app to 9 and want to apply the {&WINDOW-NAME}:SHOW-IN-TOOLBAR attribute to a whole heap of existing procs.

If you want to apply the attribute then you don't have to do a thing since, Like Lee said, it defaults to true.

If you want to set it to false then sed (stream editor) would proably the easiest and fastest method. Would be nice for yourself if you have a list of programs which need to be changed. I did lots of bulk changes in UIB files using sed. If you know what and where you are doing it then it shouldn't be a problem.
The option Lee mentioned (write a Progress program) is also an option.

In both cases, only do it on a copy of the sources, so nothing gets damaged if anything should go wrong :awink:

Finally to Joey:
Wat do you mean with this "typist"? What purpose are you thinking of? Could you elaborate a bit more on your idea....

Greetz,

Casper.
 
Thanks for the replies and suggestions guys, sorry if I was a little vague but what I really want to be able to do is set the SHOW-IN-TASKBAR within my application depending on each user's requirement. My app has it's own "taskbar" that maintains each running procedure and allows users to start new ones and switch to & close running ones, so it is quite feasible that some users will want to disable the task bar option.

Progress states the SHOW-IN-TASKBAR attribute can be programatically set but must be done so before a window is realised. That's all well and good but how the heck to I do it? I'm a bit of a newbie in managing widgets but it seems from the few tests I've done so far you can't get the window handle UNTIL the window has been realised and are thus in a catch-22 situation.

It's not a showstopper as I could use a sed to set it to FALSE across the board, or in fact just maintain the sattus quo and leave all the windows in the taskbar; but it would be kind of nice to be able to do it on the fly...

Any suggestions any of you have would be greatly appreciated.

Cheers :)
 

Casper

ProgressTalk.com Moderator
Staff member
Hi,

Just an idea:
Put the preferences (show-in-task-bar true or false) in ini file or table and give every window an logical input parameter and start every window with: RUN window-name(INI-value = 'SHOW') (for example).
Still need to rewrite the entire application, but this can be done pretty quick with sed or any other editor....

Downside is you can't just run the window without the input paramer, which can be a drag when designing the window.

Another option, when you have thick client (client/server), is to set a session global variable and use that to set show-in-taskbar properly.

Another another idea is to start session with -param and aks value with session:parameter.

After create window statement you put: show-in-taskbar = lp_showintaskbar.

Casper.
 
Top