APPLICATIONSPROGRAMMATION ★ Amstrad CPC Promenu ★

PromenuApplications Programmation
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

This program allows menus to be easily included in your own programs. Examples of how to create and use menus within programs are given.

Two lines could not be printed and must be added to the program:

50370 LOCATE 1,v:CALL &BD19: PRINT"[CONTROL—X]"+m$(v)+ SPACE$((wi)—LEN(m$(v)))+" [CONTROL-X]";
50750 IF mh$<>"" THEN WINDOW £w(ml-1,mr,mt-2,mb: LOCATE £w,1,1 :PRINT £w"[CONTROL-X] [SPACE]"+mh$+"[SPACE] [CONTROL-X]";

In these lines, type the bits between square brackets as single characters.

To create windows, certain variables have to be set and then a particular subroutine called. An example is line 130. The variables are: ml — left position of window mt — top of window am — height of window wi — width of window w — the window number (0-7) mh$ — the title of the window GOSUB 50420 is used to create a window with a normal frame, GOSUB 50620 for one with a pulldown menu frame. If a window is accidentally positioned off-screen, it will be moved back on at the nearest point.

To create a menu, the options have to be in data statements as in line 180. The data is held as follows: DATA menuno,type,title,xpos,ypo-s,option,option,..

  • menuno — used in conjunction with off(menuno,optionno)
  • type — 1 for ordinary, 2 for pulldown menu
  • title — any string, can be blank xpos — left position for menu, 0 to, centre on x plane
  • ypos — top position for menu, 0 to centre on y plane
  • option — the option name; if left blank, a line of separators will appear in its place
  • * — marks the end of the list of options

The maximum number of options in a menu is 23, or 22 if a title is used. Options within a menu can be switched off at any time using the off function:

off(menuno,optionno)=1

The result is to display the option in light type and prevent it from being selected until it's set to 0, which switches it on again.

The program only works on the 464 and 664, but to convert it for the 6128, delete lines 70 and 51110 to 51200. Then replace the RSX calls in lines 50030 and 50260 with the equivalent on the 6128 using the bank manager RSXs supplied with the machine.

To use the menus, use the cursor and copy keys. To incorporate them into your own programs, lines 50200-50260 do the selecting and v holds the value of the position of the selection bar at the end, so this can be used to determine the course of action to be taken.

The variables holding the key codes for up, down and select are ku, kd and kf respectively.

Australian Personal Computer

★ PUBLISHER: Australian Personal Computer
★ YEAR: 1986
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LiCENCE: LISTING
★ AUTHOR: Kevin Nixon

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listing:
» Promenu    (Australian  Personal  Computer)    LISTING    ENGLISHDATE: 2018-09-23
DL: 224
TYPE: PDF
SiZE: 277Ko
NOTE: 2 pages/PDFlib v1.6

★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
» Applications » Laser Genius
» Applications » Agral-86
» Applications » DASM v1
» Applications » Pyradev Colour Setup
» Applications » Defspr - Lispr - Creget (Amstrad Magazine)
» Applications » Turbo Lader Business
Je participe au site:
» Vous avez des infos personnel, des fichiers que nous ne possédons pas concernent ce programme ?
» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.

CPCrulez[Content Management System] v8.7-desktop/c
Page créée en 291 millisecondes et consultée 999 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.