PDA

View Full Version : Replacement for _SCREEN



robertjacobs
2013-03-07, 12:51
In VFP many apps use the _SCREEN system variable as the main container which normally includes a menu system and an associated toolbar. What is the recommended approach in Lianja to handle this behaviour. Is it the PAGE object?

barrymavin
2013-03-08, 00:35
I guess we could predefine _screen as a "Form" to satisfy this. Please submit an ER as a ticket so it gets on the todo list.

barrymavin
2013-03-08, 00:39
In fact further to investigating this I have added _screen in as a predefined "Form" in RC4 so no need to submit an ER.

robertjacobs
2013-03-08, 08:30
Nice. I noticed when doing a quick test where Form1 opens Form2 that each form instance appears on the task bar. Can _SCREEN be the application and all forms are contained within it? In VFP there was DESKTOP property to handle this.

barrymavin
2013-03-08, 08:33
I can take a look at that. Please submit an ER though or it will get lost in the forums.

robertjacobs
2013-03-21, 14:03
I noticed _SCREEN was added to RC4. From the console ? _SCREEN.NAME returns a value; however specifying any other property or method causes shutdown error.

barrymavin
2013-03-21, 21:44
Yes this has already been fixed in RC5.

_screen is declared as an internal "Form". You have to show() it if you want to use it.

robertjacobs
2013-03-22, 09:52
The MENU and TOOLBAR controls are working great so far. I am looking forward to adding these to the _SCREEN form in RC5 which will be the master screen for converted VFP apps. Two additional questions...

1) Are there builtin functions to assign menu items for CUT, COPY and PASTE?
2) What is the Lianja control (or equivalent) for STATUSBAR?

barrymavin
2013-03-22, 10:01
Withut looking at the code you can just assign accelerators using & i believe.

statusbar is a property on the form (and therefore _screen too).

message is a property that updates the message in the statusbar.

robertjacobs
2013-03-22, 10:07
Sorry. Should have read HELP documentaion before posting - It's all there.

barrymavin
2013-03-22, 10:07
Aso worth mentioning is autosuggest on textbox controls. Try it and see. e.g.

mytextbox.autosuggest = "select name,address,amount from yourtable"

Type a character and it will drop down a multi column grid to choose an item from.

RC5 also exposes placeholder on textboxes too.You these instead of tooltips for empty fields. e.g.

mytextbox.placeholder = "Specify a company name here"

robertjacobs
2013-06-28, 17:47
I ran a couple of quick tests using RC6 and wondering if a couple of things are possible.

1) _SCREEN no longer shows as a Windows task. Also when running from desktop using LIANJA APP.PRG the app minimizes to the desktop because there is no task.
2) Can _SCREEN (main window) be special in the sense that the titlebar is always highlighted and menus are enabled when another window is open. Menuitems would be disabled for modal forms only.
3) I have submitted a ticket to Add SHOWWINDOW property. Not sure if SHOWWINDOW will address this but you should not be able to click/activate an already opened form from a modal form.

barrymavin
2013-06-28, 22:39
I ran a couple of quick tests using RC6 and wondering if a couple of things are possible.

1) _SCREEN no longer shows as a Windows task. Also when running from desktop using LIANJA APP.PRG the app minimizes to the desktop because there is no task.
2) Can _SCREEN (main window) be special in the sense that the titlebar is always highlighted and menus are enabled when another window is open. Menuitems would be disabled for modal forms only.
3) I have submitted a ticket to Add SHOWWINDOW property. Not sure if SHOWWINDOW will address this but you should not be able to click/activate an already opened form from a modal form.

I will take a look.

What do you mean by "the titlebar is always highlighted" -- thats a function of the operating system. The title bar of the active window is the only one activated.

When you select another window it becomes active and its menus should be enabled now. Where is that not the case? It should only happen when you open up a modal window.

robertjacobs
2013-07-06, 17:41
Again, sorry for the late reply (just returning from vacation).

Talking VFP, _SCREEN represents the app which is always active meaning the app titlebar is always highlighted regardless to which windows are open and which window is active. The titlebars for _SCREEN and the active window are highlighted.

If _SCREEN represents the common interface for the entire app, then the Menu system and Toolbar should be active when a modeless form is active and menu items should be disabled when a modal form is active. Maybe you will say that the app needs to do this internally.

barrymavin
2013-07-06, 21:58
I trust you had a restful vacation.

On all windowing systems whether that be Windows, Mac or Linux you can only have one "Active" window at a time. The underlying operating system decorates the title bar of the window based on whatever theme you have selected (in the operating system).

Windows that are not application modal in Lianja i.e. using show() rather than show(1) being called are enabled therefore the menubar (and toolbar) for that window is enabled and all its UI controls contained within it.

They are only disabled when you have a modal window (using show(1) ). Thats a function of the operating system and has nothing to do with Lianja.

robertjacobs
2013-07-08, 09:23
It must be something then that VFP does internally based on the DESKTOP setting. When opening a form (modal or modeless) with DESKTOP=.F. then the _SCREEN titlebar and menubar remain highlighted. Also when opening a modal form (not modeless), all menu items on the _SCREEN menu are disabled.

barrymavin
2013-07-08, 09:43
It does not use native windows. Hence that behavior. Click on any window title in windows and the titlebar highlights the window with focus.

robertjacobs
2013-07-08, 10:18
Based on the current behaviour in Lianja then this is the dilemma when thinking about running a VFP app and how it currently behaves...

If _SCREEN (i.e. the main parent) contains the main menu which gives access to open to ALL forms within an application then the menu bar should remain enabled (highlighted) to give a visual cue that the user can open another form (when a modeless form is active) and as well access commands/shortcuts typically found in File and Edit menus.

barrymavin
2013-07-08, 10:21
If you are running non-modal forms then the menu is enabled so I don't see how thats an issue at all.

robertjacobs
2013-07-08, 10:29
The _SCREEN menu is enabled when you click on it. However the menu displays as disabled when a form (non-modal) is active giving the impression that the _SCREEN menu is not accessible.

barrymavin
2013-07-08, 10:31
I will look into that. Thats a simple fix.