r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[View] discuss view related issues

Henrik
21-Apr-2009
[8589]
am I right that an INFORM window can't be used with INSERT-EVENT-FUNC 
or is there a way around that?
Dockimbel
21-Apr-2009
[8590x2]
INSERT-EVENT-FUNC is inserting events in system/view/screen-face/feel 
while INFORM uses system/view/window-feel as window's feel object.
You can try hacking system/view/window-feel to process events from 
system/view/screen-face/feel like that (quick hack, untested) : 

svwf: second get in system/view/window-feel 'detect 

insert svwf bind [system/view/screen-face/feel face event] first 
pick svwf 5
Henrik
21-Apr-2009
[8592]
hmm... I don't think I want to do that. I'll do something with view 
instead.
Henrik
22-Apr-2009
[8593x3]
there is no window list for ordinary windows, like there is for INFORMs 
with system/view/pop-list?
system/view/screen-face/pane seems to be the solution.
Doc, it looks almost as if you are right, but I haven't gotten it 
to work yet, i.e. the feel for the INFORM does not respond like it 
should.
Graham
23-Apr-2009
[8596x5]
I've got this puzzling problem.  I have a function that brings up 
a rebgui window with some elements in it.  The elements are defined 
as local to that function.  The function is invoked by clicking on 
a table element in another window.
Now if I double click instead in the first window instead of single 
click to bring up that function, the named variables declared as 
local are now none!
If I don't make them local, but leave them as global, then there 
is no problem.
the double click action is an empty block
Hmm.  Doesn't happen in VID so must be a rebgui issue.
TomBon
23-Apr-2009
[8601x3]
; I need 100 rows like these both samples with unshared data access 
for each row.

; I have also tried with stylize/master (panel with) to construct/compose 
a master 

; row like this but doesn't succeed. any change to make this work?


list-func: func [] [ layout/tight [across x: text "x"  y: text "y" 
z: progress 0.5   w: box 40x20 effect [ draw arrow blue rotate  60 
]   ] ]

view layout [
	a: box 300x50
	b: box 300x50
	do [a/pane: list-func]
	do [b/pane: list-func]

 btn "set a" [a/data: [x/text: "1" y/text: "2"  z/data: 0.8 w/effect: 
 [ draw arrow red rotate  180 ]   ]  show a ]

 btn "set b" [b/data: [x/text: "1" y/text: "2"  z/data: 0.8 w/effect: 
 [ draw arrow red rotate  180 ]   ]  show b ]

 btn "set"   [x/text: "1" y/text: "2"  z/data: 0.8 w/effect: [ draw 
 arrow red rotate  180 ] show b  ]
]

quit
or how to supply data to a standard list containing progress and 
draw elements like this one above?
view layout [
        below
        p-list: list 550x180 [
                across origin 2x2
                chk: 	check true 
		a1: 	text wrap 100
                a2: 	text wrap 100
		pg1: 	progress 40x20 0.5
		pg2: 	progress 40x20 0.2
		a3: 	text wrap 20
		arr-1: 	box 40x20 effect [ draw arrow red rotate  180 ]
        ] supply [
                if count > length? t [face/show?: false exit]
                face/show?: true
                face/text: t/:count/:index
		;; face/data: d/:count/:index
        ]
	
	btn "set" [ ] 
]
Gregg
26-Apr-2009
[8604]
LIST doesn't iterate styles that need state (IIRC). I would generate 
the layout dynamically and put the whole thing into a scrolling pane, 
unless that ends up being too slow or memory intensive.
Anton
26-Apr-2009
[8605]
I agree. It's very difficult to make a lot of styles behave properly 
when iterated by a LIST. (And I've tried, believe me.) It's better 
to make a window full of real faces and scroll your data through 
them yourself.
TomBon
26-Apr-2009
[8606]
thx for direction gregg and anton, will create a custom face for 
this.
Maxim
1-May-2009
[8607x3]
anyone had issues with view popups when inserting a custom event-handler?


I'm doing something in view, nothing patched, wake event left as-is... 
I have an inserted an event-handler, and the moment I click on a 
choice, all the events stop... even time events.


I don't even receive events at my handler, so its not a "returning 
none from event-handler" type bug... any ideas, fixes, similar unsolvable 
observations?
this is mighty strange... doesn't seem related to the event handler 
finally... I commented-out that part of my code and the choice still 
hangs my app!
found it... related to some hierarchichal library loading... which 
inadvertently ended up loading glayout which replaces the popup handling 
by its own. so all is good... sorry for jumping the gun.
jocko
2-May-2009
[8610]
Is 'image-filter implemented in R2 ? Or is there another interpolation 
 means to improve the display of an image when changing it's size? 
Of course, I do not want to use external means like ImageMagick.
Henrik
2-May-2009
[8611]
jocko, only for upwards scaling unfortunately. No, you can't make 
good looking thumbnails in R2. :-/
jocko
2-May-2009
[8612]
I am not looking for thumbnail generation, but for image display 
with rescaling with fractional zoom factor (let's say between 0.5 
and 2.0). When using effect resizing in a layout, the interpolation 
mode is nearest. Is it possible to set it differently (i.e. bilinear) 
?
Henrik
2-May-2009
[8613]
I'm not sure the View engine supports filtering at all. The DRAW 
engine does for upward scaling, but not downward scaling < 1. I only 
mentioned thumbs, because it's a common scenario. :-)
jocko
2-May-2009
[8614]
ok, anyway,  to my opinion, it'a a must for the R3 engine.
Henrik
2-May-2009
[8615]
R3 does this elegantly already: It's based only on DRAW and all options 
for filtering from AGG are exposed. It fully supports high quality 
down and upscaling. :-)
jocko
2-May-2009
[8616]
Nice ! Another reason to expect a close beta release !
Steeve
2-May-2009
[8617]
Hey what are you saying, you can do the scaling you want  with Draw...
jocko
2-May-2009
[8618]
yes for the scaling,  but it seems that there is no interpolation 
(apart from nearest)
Maxim
3-May-2009
[8619]
is there a definite documentation on the systray support in windows? 
 I have some working code (from Izkata) but I am wondering if there 
is more to the interface than what I am using.

an exhaustive code example could also suffice
[unknown: 5]
3-May-2009
[8620x2]
I don't even think I used systray in REBOL since going to Vista. 
 So dunno if it works on Vista.
I would give you what I got but it is in archives as part of my easyserv 
project long ago.
Maxim
3-May-2009
[8622x4]
anyone know how to change the system tray icon dynamically?  by this 
I mean... the winapi calls which play around with that?
can anyone explain to me why offset on para and font do nothing every 
I try to use them?
I could use the scroll, but since its a field, the moment I enter 
text, the scroll goes back its default, which is badly aligned with 
the fields I am trying to get clean  \ :-(
ahhh I forgot that the para's offset is called origin... its been 
a while since I've tinkered with VID  :-)
Steeve
4-May-2009
[8626x2]
Jocko, in R2 if you use effect dialect to resize images, yes it uses 
nearest interpolation.
But draw uses blinear by default.
see:

img: logo.gif
siz: img/size * 4
view layout [
	below
	image img
	image img siz effect [aspect]
	box siz effect [draw [image img 0x0 siz]]
]


In R3 it's annouced that  image-filter supports NEAREST,BILINEAR,BICUBIC 
and GAUSSIAN interpolation
We can do a other missing interpolations in R2 wit maths, but it 
will be slow...
Henrik
4-May-2009
[8628]
do http://www.hmkdesign.dk/rebol/thumbtest/thumbtest.r


A small test I did to compare methods for generating thumbnails in 
R2.
Steeve
4-May-2009
[8629]
uh ? they are not done with Rebol are they Henrik ?
Henrik
4-May-2009
[8630]
The 3rd party ones (the last two) are pre-done. The rest are done 
with R2.
Gregg
4-May-2009
[8631x2]
Max, I found some old systray experimental code. No guarantees.
REBOL []

; r/3 = 'activate = left-click
; r/3 = 'activate = rt-click+menu-item-sel

hex: func [
    {Returns the base-10 value of a hexadecimal number.}
    value [integer! string! issue!] "A hexadecimal number"
][

    ; Convert to an issue first, so integers can also be translated.
    to integer! to issue! value
]

make-elements: func [name count type /local result][
    if not word? type [type: type?/word type]
    result: copy "^/"
    repeat i count [
        append result join name [i " [" type "]" newline]
    ]
    to block! result
]

NOTIFYICONDATA: make struct! compose [
    cbSize  [integer!]
    hwnd    [integer!]
    uId     [integer!]
    uFlags  [integer!]
    uCallBackMessage [integer!]
    hIcon   [integer!]
    (make-elements 'szTip 64 #"@")  ; CHAR
] none
NOTIFYICONDATA/cbSize: length? third NOTIFYICONDATA

;change at third NOTIFYICONDATA 25 "New ToolTip!"
;probe NOTIFYICONDATA
;halt

;constants required by Shell_NotifyIcon API call:
NIM_ADD:     hex 0
NIM_MODIFY:  hex 1
NIM_DELETE:  hex 2
NIF_MESSAGE: hex 1
NIF_ICON:    hex 2
NIF_TIP:     hex 4
WM_MOUSEMOVE:       hex 200
WM_LBUTTONDOWN:     hex 201  ;   'Button down
WM_LBUTTONUP:       hex 202  ;     'Button up
WM_LBUTTONDBLCLK:   hex 203  ; 'Double-click
WM_RBUTTONDOWN:     hex 204  ;   'Button down
WM_RBUTTONUP:       hex 205  ;     'Button up
WM_RBUTTONDBLCLK:   hex 206  ; 'Double-click


;Public Declare Function SetForegroundWindow Lib "user32" (ByVal 
hwnd As Long) As Long

lib: load/library %shell32.dll

Shell_NotifyIcon: make routine! compose/deep [
    dwMessage [integer!]
    pnid      [struct! [(NOTIFYICONDATA)]]
    return:   [integer!]
] lib "Shell_NotifyIconA"


my-hwnd?: does [second get-modes system/ports/system [window]]

set-tray-tooltip: func [struct string] [
    change at third struct 25 string
    struct
]



system-awake: func [port /local evt][
    if all [evt: pick port 1  (evt/1 = 'tray)] [
        status/text: mold evt
        show status
;         if any [
;             (evt/3 = 'activate)
;             all [(evt/3 = 'menu)  (evt/4 = 'desktop)]
;         ] [
;             if not desktop-loaded [
;                 link-exec-start-desktop/force
;             ]
;         ]
;         if all [(evt/3 = 'menu)  (evt/4 = 'quit)] [quit]
    ]
    false
]

system/ports/system/awake: :system-awake
append system/ports/wait-list system/ports/system

view layout [
    style button button 200
    button "Add Tray Menus" [
        set-modes system/ports/system compose/deep [
            tray: [
                add main [

                    help: (rejoin ["REBOL/Link" any [""]]) ; tooltip

                    menu: [test: "Test" desktop: "Start Desktop" bar quit: "Quit"]
                ]
                add other [
                    ;help: (rejoin ["REBOL/Link" any [""]])
                    menu: [test-2: "Test-2" bar quit-2: "Quit-2"]
                ]
            ]
        ]
    ]
    button "Remove Tray Main Menu" [
        set-modes system/ports/system [
            tray: [remove main]
        ]
    ]
    button "Remove Tray Other Menu" [
        set-modes system/ports/system [
            tray: [remove other]
        ]
    ]
    ;button "Change Tray Other Menu" [
    ;    set-modes system/ports/system [
    ;        tray: [
    ;            change other [
    ;                help: "New Help!"

    ;                menu: [test-3: "Test-3" bar quit-3: "Quit-3"]
    ;            ]
    ;        ]
    ;    ]
    ;]
    button "Modify Tooltip" [
        nid: make struct! NOTIFYICONDATA none
        nid/hwnd: my-hwnd?
        nid/uid: 1
        nid/cbSize: length? third nid
        nid/uFlags:  NIF_TIP  ; NIF_ICON
        ;nid/hIcon:
        ;nid/szTip:  "New ToolTip!^@"
        set-tray-tooltip nid "New ToolTip A!"
        ;print mold third nid
        res: Shell_NotifyIcon NIM_MODIFY nid
        print [res to logic! res]
    ]
    button "Modify Other Tooltip" [
        nid: make struct! NOTIFYICONDATA none
        nid/hwnd: my-hwnd?
        nid/uid: 2
        nid/cbSize: length? third nid
        nid/uFlags:  NIF_TIP  ; NIF_ICON
        ;nid/hIcon:
        ;nid/szTip:  "New ToolTip!^@"
        set-tray-tooltip nid "New ToolTip B!"
        ;print mold third nid
        res: Shell_NotifyIcon NIM_MODIFY nid
        print [res to logic! res]
    ]
    button "Unview" [unview]
    status: text 200
]



free lib
Maxim
7-May-2009
[8633]
thanks!! I'll look into this :-)
Pekr
7-May-2009
[8634]
Systray? Systray was done by Cyphre for me on contract, and released 
for free. IIRC Cheyenne used it at some point ...
Janko
7-May-2009
[8635]
If there wouldn't be a systray I probably wouldn't switch my bigger 
project to rebol and consequently started with all projects in rebol.. 
cheyenne was the most cruicial reason, if there wouldn't be cheyenne 
I would never switch -- but systray was the final nail in the coffin 
of the previous languge for that particular project. So, thanks  
Pekr and Cyphre!
Henrik
9-May-2009
[8636]
Is there a simple way to replace one style with another in a pane? 
I would like to interchange a FIELD and an INFO in the same spot, 
but by directly altering the field face.
ICarii
9-May-2009
[8637]
do you mean as in hidden pane swapping?
Henrik
9-May-2009
[8638]
tighter than that. it must be the face itself that should be swapped.