Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
GUI-Example: WB-like BorderScrollbars
#1
Wenn man ein Fenster erzeugen will, das ringsum dieselben Scrollbars und auch Pfeile hat, wie man sie von den Workbench-Fenstern kennt, geht man folgendermaßen vor:

Es wird aktuell noch nichts gescrollt, das kann man implementieren, wie man mag; also Superbitmap oder eine eigene Liste usw..
Code:
; BorderGadgets Example BlitzBasic2
; by F.Brandis


FindScreen1

;We Use a GZZ Window Type, therefore we have our own
; Rastport we can draw upon inside the window`s frame
; with origin 0,0

;note the negative coords!
; the winborder gadgets have a relative size
;    to the windows dimensions

;don`t forget special GZZ flags all around
;Note:
;to be really font-sensitive we should get the screen's Barheight for setting the correct y-pos of the right scrollbar

PropGadget 2,-13,16,$11000|16|2|128|256,1, 11,-50 ;right vert
PropGadget 2,  3,-7,$18000|8|4|64|256  ,2,-54,6   ;botm horiz
SetVProp   2,  1,0,1
SetHProp   2,  2,0,1

;here too,
;relativity flags are req. for positioning:

;%10 = rel. to bottom edge (if window is resizable)
;% 1 = dito right edge

;so all x,y are negative as relative to the right/bottom
;   from their dimensions

ArrowGadget2,3,$B,-17,-31,%11,1   ;up
ArrowGadget2,4,$D,-17,-20,%11,1   ;down

ArrowGadget2,5,$A,-49,- 9,%11,1   ;left
ArrowGadget2,6,$C,-33,- 9,%11,1   ;right

;note:                   x400 for GZZ window
Window 2,140,90,200,100,$14FF,"scroll me",0,2,2


Repeat

Until WaitEvent=$200
End
   
Zitieren
#2
*Superbitmap next* Big Grin
Zitieren
#3
Versucht mal dieses hier:
   
Zitieren
#4
Man kann diese Pfeil-Gadgets auch innerhalb eines Windows nutzen, dafür setzen wir das GZZ-Flag (und natürlich auch die Rel-Flags) jeweils auf 0 und nutzen absolute Koordinaten:
:

Code:
.
; ArrowGadgets Example BlitzBasic2
; by F.Brandis


FindScreen1

ArrowGadget2,3,$B,50,20,0,0   ;up
ArrowGadget2,4,$D,50,50,0,0   ;down

ArrowGadget2,5,$A,25,35,0,0   ;left
ArrowGadget2,6,$C,76,35,0,0   ;right

Window 2,140,90,200,100,$14FF,"arrow me",0,2,2

Repeat

Until WaitEvent=$200
End


   
GadgetJam?

Interessanterweise kann man auch andere Classimages statt der Pfeile ausprobieren, aber die Fehlerbehandlung innerhalb der Library (gadgetlib.obj) läßt das nicht wirklich zu. 
Aber zum Spaß einfach mal z.B. statt $A (left) eines hiervon eingeben; man braucht amigalibs.res resident.
Code:
#DEPTHIMAGE    ;Window depth arrangement image.
#ZOOMIMAGE    ;Window Zoom image.
#SIZEIMAGE    ;Window Sizing image.
#CLOSEIMAGE    ;Window close image.
#SDEPTHIMAGE    ;Screen depth arrangement image.
#LEFTIMAGE    ;Left arrow image.  die kennen wir schon!
#RIGHTIMAGE    ;Right arrow image.
#UPIMAGE    ;Up arrow image.
#DOWNIMAGE    ;Down arrow image.
#CHECKIMAGE    ;Checkmark image.
#MXIMAGE    ;Radio button image.
;Kickstart 3.0 oder höher
#MENUCHECK
#AMIGAKEY
   
Zitieren


Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste