World: r3wp
[!RebGUI] A lightweight alternative to VID
older newer | first last |
Graham 27-Feb-2006 [3033] | that was quick Ashley! |
Izkata 27-Feb-2006 [3034] | keycodes were a part of VID, which the source of 'display seems to use.... |
Ashley 27-Feb-2006 [3035] | I added them back in 0.3.2. Note that case does not matter: #"a" will match both "a" and "A". keycodes were a part of VID, which the source of 'display seems to use ... correct on the first count, but keycodes in VID are implemented via the global events system which is not used in RebGUI (for those who are interested and have the SDK sources; have a look at %view-vid.r - Carl's comments make interesting reading). RebGUI uses a much simpler (and dare I say more efficient) approach whereby the layout function (%rebgui-layout.r) collects keycode / face pairs and places them in a keycodes block at the window level (%rebgui-display.r). These keycodes are used by the 'process-keystroke function in %rebgui-edit.r. All this is very different from the way in which VID does this. |
Gregg 28-Feb-2006 [3036] | That sounds like a good approach Ashley, kind of like Windows accelerator tables. |
Ashley 28-Feb-2006 [3037x3] | Doing it at the window level has a lot of advantages; namely: 1) automatically supports / handles duplicate keycodes across multiple windows 2) scales well (a window without keycodes doesn't carry the same overhead as one with lots) 3) can have multiple keycodes referring to the same face (for efficiency, RebGUI's layout function only uses the last one specified) 4) can have a keycode that refers to multiple faces (for sanity's sake, RebGUI only acts upon the first face referred to) |
Robert: "... a way to specify a starting size of the window that's not maximized. I want my app started with a size of 1024x768" Is that inclusive or exclusive of: 1) OS Window title bar and borders (which varies not only between OS, but also OS version and what DPI settings are in force) 2) Taskbar size and position (Windows) or Dock size and position (Mac) or ... (Linux) Also, what happens if: 1) My display is 800x600, or the more common 1280x1024 2) I use a TabletPC or have an LCD in 768x1024 portrait mode? 3) Someone wants to use my app on a small PDA (300x200) These are hard issues for a GUI designer to address in a generic manner. RebGUI provides some generalized approaches: 1) margin, gap, slider width, cell and font sizes - so you can choose sizes appropriates for the target display device 2) colors - so you can cater for 256-color (or lower) devices 3) Auto-resize directives (#HWXY) combined with /maximize - so your displays can use all available space without having to know the resolution in advance 4) /position refinements that are generic (top, bottom, first, second) - so you can design layouts in terms of, "I want this display on the left and this one on the right" So the long answer to this question is, wanting to set an explicit display size is the wrong approach unless you are targeting a specific resolution device - and in that case just design your displays to use /maximise and be done with it. ;) | |
Robert: "Is there a way to re-use widgets like done with 'style in VID? For example: I have a drop-list specification, I need at several places but I don't want to copy the code." Short answer, no. If you have a "style" that is sufficiently different from the base widget (that is used often) then consider: 1) modify the widget's defaults in %rebgui-widgets.r, or 2) modify them inline, as in: ctx-rebgui/widgets/<widget>/<facet>: <value> 3) derive a new widget that works exactly the way you want. | |
Gabriele 28-Feb-2006 [3040] | Ashley: there is a reason, though, why VID was done that way. What happens if you add a face to a window's pane? VID allows that without any special processing. In your case you need to update the keycode table for the window. |
Ashley 28-Feb-2006 [3041] | And more. In VID you can quite easily add a face to another face's pane, whereas in RebGUI you sometimes want to add (or replace) a particular widget in a display with another (there is little need in RebGUI to add faces to a pane as these low-level details are taken care of by the widgets themselves). |
Graham 2-Mar-2006 [3042x3] | I'm finding that some of my windows won't respond to using keycodes. |
display "Keycode" [ text "test" return button "Close" #"^[" [halt] ] do-events | |
doesn't respond to esc key | |
Ashley 2-Mar-2006 [3045] | Added to issues. I think it is being [erronously] trapped by the area / field undo functionality. |
Graham 2-Mar-2006 [3046] | that's going to be tricky to solve then. |
Ashley 2-Mar-2006 [3047] | Not really. RebGUI can work out what widget currently has focus (if any) AND if it's a widget that has undo support enabled. |
Graham 2-Mar-2006 [3048] | got a quick fix then ? :) |
Ashley 2-Mar-2006 [3049] | When I get some time to look at it. ;) |
Graham 2-Mar-2006 [3050x2] | can you have more than one keycode for a field? |
eg. I want to use space and ^M for "OK" | |
Ashley 2-Mar-2006 [3052] | ESC can be fixed by changing the last few lines of 'process-keystroke (in %rebgui-edit.r) to read as follows: ; #"^[" [ ; ; ESC ; hide-popup ; ] ][ either all [ event/key = #"^[" find view*/pop-list view*/pop-face ][ hide-popup ][ ; if key is assigned to an action do it if any [ not view*/focal-face find [button] view*/focal-face/type ][ if f: select face/keycodes event/key [f/action f exit] ] ] ] Only the last of multiple keystrokes provided is used; but note that SPC is already mapped to button (so specifying #"^M" would give it two mappings ... a keystroke mapping and it's base "SPC activated on focus" default). |
Graham 2-Mar-2006 [3053] | in an alert, does the "OK" button automatically have focus? |
Ashley 2-Mar-2006 [3054] | No, but it should. |
Robert 3-Mar-2006 [3055x2] | startup-size: I know about all the problems. But I just want to be able to specify it. Because my app will work this way. It's not intended for 800x600 in the first version. At the moment I have to click on the window and move it, to get the min-size size. |
style: Hmm... ok. I'll have a look how to get it done. | |
Ashley 3-Mar-2006 [3057] | So the question remains; do you want to specify "size" inclusive or exclusive of OS title-bar and window border(s)? If min-size was enforced on opening the window (if that's even possible) would that suffice? |
Robert 4-Mar-2006 [3058] | Yes, because I than I just would use 1000x750 and that's great. |
Robert 7-Mar-2006 [3059] | Skinning: Is it possible ot skin RebGUI in a way that things like tabs look Mac like, or that I can add some eye-candy? |
Pekr 7-Mar-2006 [3060x3] | yes, Rebgui looks very vague :-) |
you can now at least change colors, I like more blue/grey combination with gradient ..... | |
but the answer in the past was that RebGUI was not meant to be that flexible .... so the chances of skinning system are imo limited ... but you can always go to 'tab style and change it yourself? | |
Robert 7-Mar-2006 [3063x2] | Yes, I know. IMO it makes sense to add a skinnig feature but a lightweight one. RebGUI is pure and minimalistic (which it isn't anyway) and in this sense should it be possible to add eye-candy stuff. |
How to set the focus to specific field? | |
Graham 7-Mar-2006 [3065] | show-focus ? |
Robert 7-Mar-2006 [3066x2] | Sounds good :-) |
What's the best way to create a number-only-input field? At the moment I just use field, where the user can input text and I first have to convert the input to-decimal to get back a number. Is there a way to just get back the number? | |
Graham 7-Mar-2006 [3068x2] | not yet. |
didec has some Vid fields for that .. but nothing yet for rebgui | |
Rebolek 7-Mar-2006 [3070] | Robert: Anton's styles are very precise on this, you can add od subtract numbers using mouse-wheel...check his rebpage. |
Allen 7-Mar-2006 [3071x2] | I've got an old up/down number style here for VID, if that's any use (though it lacks auto-repeat when the mouse is held down, I'm sure someone could add that easity). http://www.rebolforces.com/reb/12/up-down.r . |
woops sorry, thought I was in VID land | |
ChristianE 8-Mar-2006 [3073] | Is there a way to set the ALL-OVER window-face option for RebGUI faces, too? I think I better ask this now instead of just assuming that it was deliberately omitted for the sake of UI responsiveness? |
Ashley 8-Mar-2006 [3074] | Deliberate ommission for the reason given. Easy to add it as another refinement to 'display if it's needed for specific widget(s); although I'd have thought this could be handled by a 'detect feel? |
ChristianE 8-Mar-2006 [3075] | Yes, of course, Ashley, DETECT may be used for that, that's what I *haven't* thought of! |
Claude 9-Mar-2006 [3076x7] | hi, |
i would like to know why i (we) must transform a resultset avec database connexion to add it to table widget on rebgui ? | |
here is a little exemple => [ | |
db: open odbc://user:[pass-:-server] stm: first db insert stm {select numutl, nom,station from dbo.users order by numutl} res: copy[] foreach row (copy stm) [ append res row/1 append res row/2 append res row/3 ] close stm close db unit-size: 4 font-size: 12 tab-size: 120x55 languages: copy [] foreach language sort read %./rebgui/language/ [ insert tail languages form replace language %.dat "" ] do show-tour: does [ display "Widget Tour" compose/deep/only[ ex-table: table (tab-size - 48x18) #HW options ["ID" left .3 "Nom Utilisateur" left .10 "Station de connexion" left .40] data (res) | |
etc... | |
] | |
and how i can change the backcolor of the result data on this widget !!!!! example => first line color blue , second red, third blue ..................... | |
older newer | first last |