Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Menu in REBOL-View

 [1/17] from: lethalman:fyrebird at: 17-Oct-2004 12:01


How can i make menus for a layout? -- Fyrebird Hosting Provider - Technical Department

 [2/17] from: carl:cybercraft at: 17-Oct-2004 10:45


On Sunday, 17-October-2004 at 12:01:22 you wrote,
>How can i make menus for a layout?
There's no specific menu style, the closest being CHOICE... view layout [ choice "aaa" "bbb" "ccc" [print face/text] box ] (BOX is just there to enlarge the window.) Alternative approach... items: ["aaa" "bbb" "ccc" "ddd"] view layout [ choice data items [print face/text] box ] Hope that helps. -- Carl Read

 [3/17] from: lethalman:fyrebird at: 17-Oct-2004 12:28


Carl Read wrote:
>On Sunday, 17-October-2004 at 12:01:22 you wrote, >>How can i make menus for a layout?
<<quoted lines omitted: 14>>
>Hope that helps. >-- Carl Read
This is surely useful, but i would like to have a menu not a choice button. I need submenus, separators and the first element shouldn't be selected... So, aren't there menus in rebol? -- Fyrebird Hosting Provider - Technical Department

 [4/17] from: carl::cybercraft::co::nz at: 17-Oct-2004 10:45


On Sunday, 17-October-2004 at 12:28:17 you wrote,
>This is surely useful, but i would like to have a menu not a choice button. >I need submenus, separators and the first element shouldn't be selected... > >So, aren't there menus in rebol?
No, not out of the box, but you can make any style of menu you like, or (more quickly;) use someone elses. Try searching through the script library and mailing list at... http://www.rebol.org/ or if the mailing-list's lack of a search annoys you, try this (older) archive of the mailing list... http://www.mail-archive.com/[rebol-list--rebol--com]/maillist.html -- Carl Read

 [5/17] from: lethalman:fyrebird at: 17-Oct-2004 12:48


Carl Read wrote:
>On Sunday, 17-October-2004 at 12:28:17 you wrote, >>This is surely useful, but i would like to have a menu not a choice button.
<<quoted lines omitted: 8>>
>http://www.mail-archive.com/[rebol-list--rebol--com]/maillist.html >-- Carl Read
Thanks, i've found this that's really a good example: http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r?script-name=menubar.r -- Fyrebird Hosting Provider - Technical Department

 [6/17] from: gabriele::colellachiara::com at: 17-Oct-2004 12:54


Hi Lethalman, On Sunday, October 17, 2004, 12:28:17 PM, you wrote: L> So, aren't there menus in rebol? Cyphre has a menu style with WinXP look that works really well. The script is called ctx-menu.r, not sure if it's in the library or not, maybe Cyphre can give you a URL. Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/

 [7/17] from: cyphre::seznam::cz at: 18-Oct-2004 8:16


Hi Lethalman and all, you can grab my latest styles package(still in alpha stage) at: http://www.rebol.cz/~cyphre/cgi-bin/styles-pack.cgi regards, Cyphre

 [8/17] from: lethalman::fyrebird::net at: 18-Oct-2004 14:10


Cyphre wrote:
>Hi Lethalman and all, > >you can grab my latest styles package(still in alpha stage) at: > >http://www.rebol.cz/~cyphre/cgi-bin/styles-pack.cgi > >regards, > >Cyphre > >-- >
Thanks very much! -- Fyrebird Hosting Provider - Technical Department

 [9/17] from: mike::yaunish::shaw::ca at: 25-Oct-2004 16:32


Hi guys, I have been playing with the list package and think it's just what I've been looking for. Can't seem to get lines added to a list that contain check boxes with any success. Can you give me a hint? Mike Yaunish

 [10/17] from: cyphre::seznam::cz at: 26-Oct-2004 8:16


Hi Mike, I'm not sure if this is what you need(watch out line breaks!): -------------------------<code begin>----------------------------------- REBOL [ title: "text list style - example with checkboxes" author: [cyphre--seznam--cz] ] do %../styles/my-list.r ; load the my-list style demo-data: copy [] repeat n 50 [ num: form n while [(length? num) < 2][insert num "0"] insert/only tail demo-data compose/deep [ [data (false)] ;<-store the current state of checkbox here(can be changed by user at runtime) (join "line " num);some test text ] ] view layout [ origin 0 lst: my-list -1x218;autosize width columns [ ;'layout' of the columns check 24x24 [face/user-data/2: face/data];updates state of cell with checkbox txt 200x24 center ] data demo-data ;data for the list rowbar ["X" "text"] ;rowbar labels for each column line-colors reduce [ivory snow]; color pattern for lines in list ] -------------------------<code end>----------------------------------- regards, Cyphre

 [11/17] from: mike:yaunish:shaw:ca at: 26-Oct-2004 11:20


Hi Cyphre, thanks for your example. I was a little hung up on inserting [data (false) ] into the list but have straightened out my thinking. I am now experimenting with trying to change the number and types of columns in the list after I have already displayed a list. A kind of redefinition of the list itself after it has already been used. Any good ideas on how I might go about that? Mike

 [12/17] from: cyphre::seznam::cz at: 26-Oct-2004 19:51


Hi Mike, just add to the layout of may previous example .... button "redefine it" [ lst/columns: [field green 100 field red 200 text red 150] lst/data: [["a" "b" "c"]] lst/rowbar: ["col 1" "col 2" "col 3"] lst/update-list ] .... HTH, Cyphre

 [13/17] from: cyphre:seznam:cz at: 26-Oct-2004 20:13


Mike, Regarding the [data (false)] case you mentioned. I decided to write a bit more about this "hidden feature". I forgot to mention that the DATA block of the my-list style is using some kind of data-dialect. If you specify cell content without brackets [] it will handle it as a text content for given cell element(VID style you are using in the columns block). Example: ........... data [[1 "hello" word]] .......... In this case the list engine fill all three cels in a row with texts "1" hello "world". That is enough for suplying cells of style TEXT, FIELD, BUTTON etc. But when you need to specify other data for given cell you need to use [] brackets which means for the engine "turn the dialect on" and supply all the stuf in the block to the style of the cell. Example: ............. data [[[data #[false]] [effect [gradient 1x1 red green]][image logo.gif]]] ............ In this case the list engine sets appropriate properties in specific cells. This way you are able to do lot of things, not only the text lists etc. basically you have a grid engine which can be easily programmed. You can also acces those data dialect blocks at runtime and modify them using face/user-data reference. for example: ....... data [[[data #[false]]]] columns [ check 24x24 [face/user-data/2: face/data] ] ...... In this case when user clicks on the checkbox the code in action block of the cell will dynamically rewrite the logical value in data dialect block so the new checkbox state is remembered when the list is refreshed. The idea of list(or grid) data dialecting is still in alpha stage(and I have still lot ideas to improve it) so feel free to made any comments. regards, Cyphre

 [14/17] from: mike::yaunish::shaw::ca at: 26-Oct-2004 16:04


Hi Cyphre, this is exactly what I needed. Thanks for this example and your further explanation of the 'data' field dialect. Mike

 [15/17] from: mike:yaunish:shaw:ca at: 1-Nov-2004 18:20


Hi Cyphre, have found that I am in need of the following and thought I would pass along what I have cobbled together. 1.) has-user-data? - Determine if any given face is actually an active gadget. Should inactive gadgets have a default behaviour that makes them check if they are valid before they can do anything? 2.) update-check - Updates the check box. Maybe this should be built into my-list as a default behaviour of the check box. Don't know enough to make this happen. 3.) get-selected-checks - Returns all check boxes that have been defined with a 'text field and been checked off. Small sample of what I mean. ;------------------------- code starts ----------------------------------- REBOL [ title: "text list style - example" author: [cyphre--seznam--cz] ] do http://members.shaw.ca/mike.yaunish/rebol/cyphre-list.r demo-data: copy [] for i 1 5 1 [ ;definition of simple data dialect (static for now...) insert/only tail demo-data compose/deep [ [data (false) type "check" text (i)] [ text (i) ] [ text (random "The Name of A Company" ) ] [data (false) type "check" text (i + 100)] ] ] view l: layout [ origin 0 space 0 across lst: my-list 640x300 columns [ check 55x25 [ ; check box template lst/update-check face ] button 70 [ either lst/has-user-data? face [ print face/user-data/text ][ print "Unassigned button" ] ] txt 100 check 35x25 [ ; check box template lst/update-check face ] ] data demo-data ;sepcifies the data for the list rowbar ["Select" "ID" "Company" "X"] ;rowbar labels for each column line-colors reduce [220.220.220 white] rowbar-height 28 slider-width 20 row-highlight return button 150x24 "get-selected-checks" [ print [ "check boxes selected = " mold lst/get-selected-checks ] ] ] ; ------------------ code ends

 [16/17] from: cyphre:seznam:cz at: 3-Nov-2004 8:12


Hi Mike, Nice work ;-) I'm glad you find my list somehow useful. But I don't think those functions should be in the style(official version) by default. The style is designed and can be used for very wide range of usage(I'm planning to write some more demos and tutorials about it when the styles-pack website will be up and running). So I left intetionally all those tiny but useful functions (which are handy for custom application) to be written by developer who is using the style as kind of "customizable low-level grid engine". Anyway, this leads me to an idea it would be good to be able create/store/use some form of "list configuration" so people could make them and easily share and use different list-setups for diffferent applications. I'm planning to create simple website for the styles-pack so It would be a good place for such things. If you have any comments ideas just let me know either here on ml or privately. regards, Cyphre

 [17/17] from: mike:yaunish:shaw:ca at: 3-Nov-2004 16:08


Hi Cyphre, after playing with it a bit I quickly realized that these customizations could get out of hand. I completely agree a "list configuration" would be what is needed. I've really needed a proper list tool and this is it for sure. I can really see the immense flexibility of this kind of approach, although I see that the installation of "list configurations" could be really interesting. I would be interested in trying to make my modifications into a list config. once you have something to play with. Keep up the great work. Mike

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted