WIMP lijst

samengesteld door Cor v.d. Heijden

Als men een programma wil maken dat met andere applicaties samenwerkt onder de Wimp dan merkt men dat men ineens een heleboel dingen tegelijk moet weten om zelfs de eenvoudigste applicatie te kunnen maken. Men moet enige gegevens hebben m.b.t. Windows Icons, menu's en pointers. In de PRM staat alles wat men nodig heeft en als men daar eenmaal doorheen gewor-steld is dan is het handig als men de belangrijkste zaken eens op een rij zet.

Dat heb ik dus ook gedaan en misschien zijn er meer mensen waarvoor zo'n lijst handig is. Ik weet dat de lijst niet volledig is en de rest komt op een later tijdstip. Voor personen die pas beginnen zijn deze gegevens te summier en zij zullen dus aanvullende info nodig hebben.

Om een window te kunnen openen zijn de volgende gegevens van belang:
Parameter blok voor SWI "Wimp_CreateWindow"
block+ 0  minimum x coordinate visible area
       4  minimum y coordinate visible area
       8  maximum x coordinate visible area
      12  maximum y coordinate visible area
      16  x scrolloffset relative to work area origin
      20  y scrolloffset relative to work area origin
      24  handle to open window in front -1 or bottom  -2
      28  window flags
      32  titel foreground and framecolour (&FF => no frame)
      33  titel background
      34  work area foregroundcolour
      35  work area backgroundcolour  (&FF => transparent)
      36  scrollbar background colour
      37  scrollbar slidercolour
      38  titel backgroundcolour when it has the inputfocus 
      39  reserved (bits must be zero)
      40  minimum x coordinate work area
      44  minimum y coordinate work area
      48  maximum x coordinate work area
      52  maximum y coordinate work area
      56  icon flags titlebar
      60  work area flags
      64  to control block for sprites (+1 for wimp sprites)
      68  minimum width of window (0 to use titlewidth)
      70  minimum height of window
      72  title data (bijv. naam. mag max 12 karakters bevatten)
      84  number of icons in initial window
      88  start of datablock for icons (for every icon 32 bytes)
windowcolours: 
	0 - 7	lineair grey (white = 0 en black =7)	
	8  	dark blue
 	9  	yellow
 	10  	light green
  	11  	red
  	12  	cream
 	13  	dark green
 	14  	orange
 	15  	light blue

Window flags (see block+28)
   	0  	not used
   	1	window can be dragged
   	2 	not used
   	3 	not used
   	4 	Wimp can redraw window without help from the task
      	(no user graphics and no indirected icons)
   	5 	window is a pane (on a tool window)
   	6  	window can extend outside screen area
   	7  	not used
   	8 	generate scroll request events
   	9  	as 8 but no autorepeat on arrow-icons
  	10 	treat window colours as GCOL rather than Wimp colours
  	11 	don't allow windows below this one
  	12 	generate key-pressed reason codes for hot keys
	13-15 	gereserved (bits must be zero)
  	16-20	used to return info only
  	21-23 	gereserved (bits must be zero)
  	24 	window has a back icon
  	25 	window has a close icon
  	26 	window has a titlebar
  	27	window has a toggle size icon
  	28 	window has a verticale scroll bar
  	29 	window has a adjust size icon
  	30 	window has a horizontal scroll bar
  	31 	must be 1

Titlebar flags  (see block+56)
  	0  	icon contains text
  	3  	contents is horizontal centred
  	4  	contents is vertical   centred
  	9  	text is right justified

Werkgebied flags  (see block+60)
  	0 	ignore all mouseclick
  	1	notify task continually while pointer is over workarea
  	2 	mouseclick notifies task (auto repeat)
  	3	mouseclick notifies only once
  	4 	release over work area notifies task
  	5 	doubleclick notifies task
  	6 	as 3 but can also drag (returns button state *16)
  	7 	as 4 but can also drag (returns button state *16)
  	8 	as 5 but can also drag (returns button state *16)
  	9 	as 3
 	10 	click returns buttonstate*256 terug drag returns buttonstate *16 terug
        	doubleclick returns buttonstate  *1 terug
 	11  	klik returns buttonstate terug drag returns buttonstate *16 terug
 	12-14	reserved
 	15 	mouseclick cause window to gain inputfocus

Parameterblock for SWI "Wimp_OpenWindow"
block+ 0	window handle
	  4	minimum x coordinate visible area
	  8	minimum y coordinate visible area
	 12	maximum x coordinate visible area
      16  	maximum y coordinate visible area
      20  	x scrolloffset relative to work area origin
      24  	y scrolloffset relative to work area origin
      28  	-1 opens window on top -2 opens window at bottom
      32  	window flags

Hierna volgen de items voor de poll_loop:
Reasoncodes door de wimp geretourneerd bij gebruik van SWI "Wimp_Poll"
   	0 	null_reason_code
   	1 	redraw window request
   	2 	open window request
   	3  	close window request
   	4 	pointer verlaat window
   	5 	pointer komt window binnen
   	6 	mouseclick
   	7	user_drag_box
   	8 	keypress
   	9 	menu selection
  	10	scroll request
  	11	lose caret
  	12	gain caret
  	13	pollword_NonZero (RiscOs 3 alleen)
  	14-16 	reserved
  	17 	user message
  	18 	user message recorded
  	19 	user message acknowledge

Informatieblok dat teruggegeven wordt door reason code 6 (mouseclick)
block+ 0	mouse x coordinate
       4  	mouse y coordinate
       8	mouse buttonstate
      12	windowhandle ( or -1 for background and -2 for iconbar)
      16	iconhandle ( or -1 for work area background)

Informatieblok dat teruggegeven wordt door reason code 8 (toetsaanslag)
block+ 0	windowhandle with inputfocus
       4	iconhandle (-1 if none)
       8	x - offset of caret (relative to window origin)
      12  	y - offset of caret (relative to window origin)
      16  	caretheight and flags
      20  	index of caret into string
      24  	charakter code of key pressed (4 byte word)

Parameterblok aangewezen door R1 SWI "Wimp_CreateIcon"
block+ 0	windowhandle  (or -2 for left of iconbar, -1 for right)
       4	minimum x coordinate of icon bounding box
       8	minimum y coordinate of icon bounding box
      12  	maximum x coordinate of icon bounding box
      16  	maximum y coordinate of icon bounding box
      20  	icon flags
      24  	12 bytes of icondata
Iconflags behorende bij "Wimp_CreateIcon" (see block%+20)
   	0 	icon contains text
   	1 	icon contains a sprite
   	2 	icon has a border
   	3 	contents horizontal centred
   	4 	contents vertical centred
   	5 	icon has filled background
   	6 	text is anti-aliased
   	7 	icon requires task's help for redraw
   	8 	icondata is indirected
   	9	text is right justified
  	10	if selected with adjust don't cancel (others in same ESG)
  	11	display sprite at half size
  	12-15	icon button type
  	16-20	Exclusive Selection Group (ESG)
  	21	icon is (already) selected
  	22	icon is not selectable (is shaded)
  	23 	icon has been deleted
  	24-27	forgroundcolour (if bit 6=0)
  	28-31	backgroundcolour (if bit 6=0)
  	24-31	font handle if bit 6=1

Icon button types
   	0	ignore mouse and pointer
   	1	notify task continuously while pointer is over icon
   	2	click notify task (auto repeat)
   	3	click notify task (only once)
   	4 	click selects icon; release over icon notifies task;
		moving pointer away deselects
   	5	click selects; doubleclick notifies task
   	6	if 3 but can also drag
   	7	if 4 but can also drag (moving pointer away doesn't deselects)
   	8 	if 5 but can also drag
   	9	pointer over icon selects; moving away deselects
		click over icon notifies task (menu icon)
  	10	click returns buttonstate*256  drag returns buttonstate *16
		doubleclick returns buttonstate  *1
  	11	click selects, and returns buttonstate *1
		drag returns buttonstate *16 (radio icon)
  	12-13	reserved
  	14	click causes icon to gain caret and parent window to gain
       	inputfocus (writable icon); can also drag
  	15	click causes icon to gain caret and parent window to gain
         	inputfocus (writable icon)

Betekenis van de 3 data words beginnend op block+24 van de iconflags voor Wimp_CreateIcon.
Sprite  Text  gebruik van de 3 data woorden
0	1	+24 pointer to textbuffer
        	+28 pointer to validationstring
       	+32 textbuffer length
1	0	+24 pointer to sprite or spritename
          	+28 pointer to spritecontrolblock (+1 for wimp sprite area)
           	+32 0 if +24 is a spritepointer length if it is a namepointer
1	1	+24 pointer to textbuffer
          	+28 pointer to validationstring which can contain spritename
		+32 textbuffer length

Parameterblok voor SWI "Wimp_SetIconState" block+0  windowhandle
(-1 for iconbar right, -2 for iconbar left)
      	4  	iconhandle
      	8  	EOR word
     	12  	clear word

Details van (C)lear word en (E)OR word voor Wimp_SetIconState    
C	E	Effect
0	0	preserve the bit's status
0	1	toggle the bit's status
1	0	clear the bit
1	1	set the bit

Parameter voor SWI "Wimp_CreateMenu"
  R1	=	pointer to menublock or -1 to close any active menu
  R2  	x coordinate of top left menu
  R3  	y coordinate of top left menu 

Menublok voor Wimp_CreateMenu mblocl+ 0  menutitle (or nullstring)
	12  	title forground and framecolour
	13  	titlebackgroundcolour
	14  	menu work area forgroundcolour
	15  	menu work area backgroundcolour
	16  	width of menu
	20  	height of each menu item
	24  	verticale gap between items
	28  	menu items 24 bytes each

Menu item data. Nodig voor elk aanwezig menu_item.
bytes  0-3  	menu flags
          	Bit meaning when set
         0   display tick to left of item
         1   dashed underline to separate item
         2   item is writable
         3   generate message when moving to submenu
         7   this is the last item in menu
            	all other bits must be zero
bytes    4-7	submenupointer (>=&8000) or windowhandle (1-&7FFF) or -1 if none
bytes    8-11	menu icon flags (as for normal icon)
bytes    12-23	menu icon data (as for normal icon)

Block dat teruggegeven wordt door SWI "Wimp_GetPointerInfo"
block+ 0	mouse x
       4	mouse y
       8	button state
       12	window handle  (-1 = background, -2 = iconbar)
       16	iconhandle
Informatie die teruggegeven wordt nadat Wimp_RedrawWindow is aangeroepen.
Deze info geldt ook voor Wimp_GetRectangle
R0 = 	0 	no more updating required.
R0 > 	0 	further updating required.
R1 wijst naar een parameterblok.
block+ 0 	window handle
       4 	visible area minimum x coordinate
       8 	visible area minimum y coordinate
       12 	visible area maximum x coordinate
       16 	visible area maximum y coordinate
       20 	scroll x offset relative to work area origin
       24 	scroll y offset relative to work area origin
       28 	minimum x coordinate current graphics window
       32 	minimum y coordinate current graphics window
       36 	maximum x coordinate current graphics window
       40 	maximum y coordinate current graphics window
Wimp message parameter block
block+ 0 	size of block in bytes (max 256)
       4 	task handle of message sender
       8 	my-ref - the sender's reference for this message
       12 	your-ref a previous message's my-ref, or 0 if not a reply
       16 	message action code
       20 	message data the format of this depends on the actiecode at block+16.

Veel succes met programmeren.

met vriendelijke groeten, Cor v d Heijden.