Here is a patch to add 'windowed' menu. This is _not finished yet_, but most of the things work quite well.
Now we can build xlib UI with the original 'widget' menu (use --with-widget parameter of configure for the old style) or the new 'xmenu'.
---------------------------
First I try to fix some 'bug':
There are some 'triplicated' function in widget/gtk/win32 UI:
- menu_file_savesnapshot()
- menu_file_savescreenasscr()
- menu_file_savescreenaspng()
- menu_file_movies_recordmovieasscr()
- menu_file_movies_recordmovieaspng()
- menu_file_recording_record()
- menu_file_recording_recordfromsnapshot()
- menu_file_aylogging_record()
I moved these functions to 'menu.c'.
There is a 'joystick_connection' array duplicated in widget/gtk UI. I moved it to 'joystick.c' and added a #define JOYSTICK_CONN_COUNT to 'joystick.h' like 'JOYSTICK_TYPE_COUNT'.
'ui/widget/memory.c':
- now it prints the correct 'address' (memaddr -> addr)
- and print 8 byte/row instead of 7 :)
'ui/widget/debugger.c':
- fix compile error: bp->value.time.tstates instead of bp->value.tstates
'ui/xlib/xui.c':
- i change 'XCheckIfEvent()' with 'xui_trueFunction()' to 'XCheckMaskEvent()' which does not need the useless 'xui_trueFunction()' :)
--------------------------
Second the 'real' changes:
There are 3 new file to implement the new X widgets:
- ui/xlib/xmenu_internals.h -- declarations for options.c and menu_data.c
- ui/xlib/xmenu.h -- 'public' header for xui.c and xkeyboard.c
- ui/xlib/xmenu.c -- :)
I add a section ( dump_x() ) into 'menu_data.pl' to create the apropriate menu_data.c file. I create (copy and modify :) 'ui/xlib/options.pl' and 'ui/xlib/options-header.pl' to create 'options.c' and 'options.h' files.
- ui/xlib/xui.c add xmenu initialization 'init_xmenu()'
- ui/xlib/xdisplay.c change 'xdisplay_depth' and 'colours[]' array to global in order to xmenu could use it.
- ui/xlib/xkeyboard.c call xmenu key handling routine if needed
About the xmenu widget 'system':
This is a pure X widget system (does not depend on Xt or even Xaw etc.), so we not need any additional (X) library.
There are three base widget type:
- menu widget
- dialog widget
- keyboard entry widget
Basically all widget is a 'vertical' container. A menu widget can hold 'menu items', 'submenu items' and 'separators'. A dialog can hold 'checkboxes', 'radioboxes', 'multiline text', 'dialog entry', 'scroll', 'button' and 'separator' entries. The keyboard entry 'widget' is a simple 'override-redirect' popup window to enter data from keyboard.
Most of the dialogs of the UI implemented, exept the 'debugger' widget, 'rollback' widget, 'picture' widget and the 'load/save binary data' widget. There is no any hotkey (exept the standard F1-F10).
How to use the new xmenu:
Press F1 to popup the main menu, or press F2 to F10 to popup the apropriate dialog. You can popup several dialog paralell.
- menu window pop down if you leave the window, or click on the window with the right or middle mouse button.
- 'scroll' widget can be scrolled up and down with the mouse roll (mouse button 4,5), or click to the up or down triangle at the right side. If you click on the triangle with the right (or middle) button it scroll up or down with a page. If you click somewhere on the 'scrollbar' the area positioned to the apropriate place.
- if you click on an 'entry' field (e.g. emulation speed), a white window popped up, where you can enter text or numbers. To finish type press ENTER, or ESC (cancel entry). DEL, BACKSPACE and left/right cursor movement keys work as usual. If it is a numeric field, you can type only numbers (0-9).
- file browse widget (open/save): if you click on the 'directory' text than an entry window popup and you can type directly file name or directory name. If you select a directory (e.g. '/..') and click on 'Open' or 'Save' the file browse change the directory.
-------------------------------
Bugs(-:
- there is no any keyboard shortcut or hotkey (yet)
- if fuse not paused and we move a dialog over the main screen, we see a very slow 'refresh' effect (e.g. with 'General Options'), but if we move a dialog while fuse paused, everything is better... (e.g. 'Open Spectrum File' dialog)...
- sometimes we encounter a big lag while use dialogs (never if emulation paused)
- there is _no_ international text support and/or the X compose input method not works
- the text cursor not blinking :)
xmenu
Logged In: YES
user_id=29214
Originator: NO
1) Can you coordinate with Fred with respect to the changes he's making for keyboardless UIs?
2) *Please*, *please*, *please* can we have *one* patch to do *one* thing, not one patch which fixes some bugs, completely changes a menu system and probably some other things as well. We've have been through this before and why it's useful!
Logged In: YES
user_id=57243
Originator: YES
"Can you coordinate with Fred...?" Of course if there is any interaction between a new Xlib UI and 'keyboardless UIs' ... Hmm... some keyboardless PDAs maybe? (Is there any PDA with X? :)
"... we have *one* patch to do *one* thing ..." This patch is _not ready_ to merge into SVN, but if somebody _want to try_ the new menus than more easy to fetch one patch instead a couple of... maybe. But of course i will split it and submit part by part... ;)