⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tcxl.doc

📁 就一个字强.很不错,希望大家能喜欢.这是我朋友发给我的
💻 DOC
📖 第 1 页 / 共 5 页
字号:
        Esc         - if enabled, cancels input and returns a zero.  Escape
                      checking can be enabled or disabled by using the
                      wsetesc() function before wmbarget() is called.  If
                      inside a pull-down menu, pressing this will cause
                      wmbarget() to return PDMAIN.

    When an option is selected, it's tag character will be returned by


                                      13   
wmbarget().  The tag character will be in the same case as when defined.  If
the Esc key was pressed and Escape checking was on, a zero will be returned and
the global variable _werrno will be set to W_ESCPRESS.  If any other error
occurred, the return value will be zero and the global variable _werrno will be
set to an error code (see TCXLWIN.H).  Once a selection is made, the wmbarget()
function automatically clears all menu options defined by wmbardef().

  If you are using wmbarget() to process a pull-down menu (PDMENU), and the
LeftArrow or RightArrow key is pressed, then wmbarget() will return PDPREV or
PDNEXT, respectively.  This allows you to input these return values back into
the main menu's wmbarget() pulldown parameter to automatically select the
previous or next pull-down window from the current pull-down window.  The
Escape checking status will be ignored while using pull-down menus.  Instead,
if in a pull-down menu (PDMENU), and the Esc key is pressed, wmbarget() will
return PDMAIN, which allows you to reinput that value back into the main menu's
wmbarget() pulldown parameter.  For a complete example of using pull-down
menus, see the example in TCXLDEMO.C.

    Another function that may be used for bar-selection menus is wmbarxcel().
This can be used if you need to cancel all defined options before wmbarget() is
called.

Example for a Bar-Selection Menu:

        int selection;
        wopen(5,10,20,50,4,LMAGENTA|_RED);
        wmbardef(2,2,LGREEN|_RED,"Add record",'A');
        wmbardef(4,2,LGREEN|_RED,"Delete record",'D');
        wmbardef(6,2,LGREEN|_RED,"Print record",'P');
        wmbardef(8,2,LGREEN|_RED,"Update record",'U');
        selection=wmbarget(LRED|_GREEN,'A',0);
        wgotoxy(10,2);
        wprintf("You selected %c\n",selection);
        waitkey();
        wclose();
























                                      14   


Using TCXL's Mouse Functions.


    TCXL has several functions used to facilitate Microsoft compatible mice.
All of these functions are prefixed with a 'ms'.  These functions will work
on Microsoft mice or other mice using a Microsoft compatible driver.  These
mouse functions allow you to:

        1.  Initialize mouse/determine if mouse exists.
        2.  Get the status of button presses/releases.
        3.  Hide/reveal the mouse cursor.
        4.  Get/set the mouse cursor position.
        5.  Select type of mouse cursor (hardware or software).
        5.  Adjust the mouse sensitivity (speed).
        6.  Get information on direction of mouse movement.
        7.  Establish horizontal/vertical boundries of mouse movement.

    When reading or setting mouse coordinates, the values used are in pixels.
To calculate mouse coordinates in terms of column and row instead of X and Y,
you would multiply character width by column, and character height by row.
Typically, screen characters are 8 pixels wide by 8 pixels tall.  So, to
position the mouse cursor at column 60, row 15, you would use:

        msgotoxy(60*8,15*8);

    The mscursor() function sets the cursor type.  It takes 3 parameters:
ctype, smask, and cmask.  If ctype = 1 then the cursor type is hardware.  The
hardware cursor is the flashing block on your screen.  If this type of cursor
is used, it will interfere with normal text cursor functions.  When using the
hardware cursor type, the value for smask is the start scan line of the cursor,
and the value for cmask is the stop scan line of the cursor.  If the ctype
parameter = 0, then a software cursor is used.  For the software cursor, the
smask parameter is the screen mask, and the cmask parameter is the cursor mask.
The screen mask determines which of the characters attributes are preserved.
The cursor mask defines how the attributes are changed to show the cursor.  For
both masks, the bit values are as follows:

        Bits 0-7:       ASCII value of character
        Bits 8-10:      Foreground color
        Bit 11:         Intensity
        Bits 12-14:     Background color
        Bit 15:         Blink

    The msmotion() function determines direction and distance traveled since
last msmotion() call.  The xcount and ycount parameters will either be negative
or positive depending on direction mouse moved.  The amount will be the number
of pixels travelled.

    When updating the screen, the mouse cursor should be hidden with the
mshidecur() function first, and then after the screen is updated, the
msshowcur() should be called to re-display the mouse cursor.






                                      15   


                       Description of TCXL Functions
                       -----------------------------


Name:       attrib
Purpose:    creates an attribute
Prototype:  int attrib(int fore,int back,int bright,int blink);
Header:     tcxlvid.h  tcxlwin.h
Inputs:     fore    - foreground color code (0-7)
            back    - background color code (0-7)
            bright  - intensity (0-1)
            blink   - blinking (0-1)
Return:     attribute
Also see:   setattr wtextattr
Example:
            prints(15,10,attrib(7,5,1,0),"Hello, world");


Name:       beep
Purpose:    sounds a beep in the speaker
Prototype:  void beep(void);
Header:     tcxldef.h
Inputs:     none
Return:     none
Also see:   sound_
Example:
            beep();


Name:       biosver
Purpose:    returns the ROM BIOS version date
Prototype:  char *biosver(void);
Header:     tcxldef.h
Inputs:     none
Return:     address of the static string containing the ROM BIOS version date
Also see:   machid
Example:
            printf("ROM BIOS version date is %s\n",biosver());


Name:       box
Purpose:    draws a box on the screen
Prototype:  void box(int srow,int scol,int erow,int ecol,int btype,int atr);
Header:     tcxlvid.h
Inputs:     srow    - starting row upper left corner
            scol    - starting column upper left corner
            erow    - ending row lower right corner
            ecol    - ending column
            btype   - box type (0-5)
            atr     - attribute
Return:     none
Also see:   attrib boxd
Example:
            box(0,0,22,79,1,WHITE|_BLUE);



                                      16   
 
Name:       boxd
Purpose:    draws a box directly on the screen (no BIOS calls)
Prototype:  void boxd(int srow,int scol,int erow,int ecol,int btype,int atr);
Header:     tcxlvid.h
Inputs:     srow    - starting row upper left corner
            scol    - starting column upper left corner
            erow    - ending row lower right corner
            ecol    - ending column
            btype   - box type (0-5)
            atr     - attribute
Return:     none
Also see:   attrib box videoinit
Example:
            boxd(0,0,22,79,1,WHITE|_BLUE);

 
Name:       capsoff
Purpose:    toggles the CapsLock key off
Prototype:  void capsoff(void);
Header:     tcxlkey.h
Inputs:     none
Return:     none
Also see:   capson kbstat numoff
Example:
            capsoff();


Name:       capson
Purpose:    toggles the CapsLock key on
Prototype:  void capson(void);
Header:     tcxlkey.h
Inputs:     none
Return:     none
Also see:   capsoff kbstat numon
Example:
            capson();


Name:       clearkeys
Purpose:    clears the keyboard buffer
Prototype:  void clearkeys(void);
Header:     tcxlkey.h
Inputs:     none
Return:     none
Also see:   waitkey
Example:
            int ch;
            printf("Press a key:  ");
            clearkeys();
            ch=getche();


Name:       clockcal
Purpose:    determines if a clock-calendar board is installed (usually this
            board will only be in XT machines)
Prototype:  int clockcal(void);


                                      17   
Header:     tcxldef.h
Inputs:     none
Return:     a non-zero value if a clock-calendar board is present
Example:
            printf("A clock-calendar is%s installed\n",clockcal()?"":" not");


Name:       clreol_
Purpose:    clears to the end of line using current attribute
Prototype:  void clreol_(void);
Header:     tcxlvid.h
Inputs:     none
Return:     none
Also see:   clrscrn clrwin
Example:
            prints(10,5,LCYAN|_BLUE,"Hello, worldXXXXXXXX");
            gotoxy_(10,17);
            clreol_();


Name:       clrscrn
Purpose:    clears the screen (up to 50 lines) using current attribute, and
            homes the cursor
Prototype:  void clrscrn(void);
Header:     tcxlvid.h
Inputs:     none
Return:     none
Also see:   clreol_ clrwin
Example:
            clrscrn();

 
Name:       clrwin
Purpose:    clears a window of the screen using current attribute
Prototype:  void clrwin(srow,scol,erow,ecol);
Header:     tcxlvid.h
Inputs:     srow    - starting row upper left corner
            scol    - starting column upper left corner
            erow    - ending row lower right corner
            ecol    - ending column lower right corner
Return:     none
Also see:   clreol_ clrscrn
Example:
            filld(10,10,20,20,'X',LCYAN|_BLUE);
            clrwin(11,11,19,19);


Name:       cvaltype
Purpose:    checks given character against given character type code,
            determines if character is valid type
Prototype:  int cvaltype(int ch,int ctype);
Header:     tcxlstr.h
Inputs:     ch      - character to test
            ctype   - character type code to compare with, see section on TCXL
                      format strings for a list of valid character type codes.
Return:     a 1 if character is a valid character type, otherwise a zero
Also see:   winpdef


                                      18   
Example:
            int valid=NO;
            char ch='Z';
            valid=cvaltype(ch,'#');
            printf("%c is %sa valid char of type '#'\n",ch,valid?"":" not");


Name:       delay_
Purpose:    delays program execution for a specified duration
Prototype:  void delay_(unsigned duration);
Header:     tcxldef.h
Inputs:     duration    - duration (0-65535) ie. 18 = 1 second
Return:     none
Also see:   timer waitkeyt
Example:
            printf("Testing\n1\n");
            delay_(36);
            printf("2\n");
            delay_(36);
            printf("3\n");


Name:       disktoscrn
Purpose:    copies a previously saved screen disk file back to the screen
Prototype:  int disktoscrn(char *fname);
Header:     tcxldsk.h tcxlvid.h
Inputs:     fname   - address of the string containing file name to read from
Return:     a zero if no error
Also see:   disktowin fexist scrntodisk
Example:
            if(disktoscrn("SCREEN.DAT")) {
                printf("Error reading input file\n");
                exit(1);
            }


Name:       disktowin
Purpose:    copies a previously saved window disk file back to the screen
Prototype:  int disktowin(char *fname);
Header:     tcxldsk.h
Inputs:     fname   - address of the string containing file name to read from
Return:     a zero if no error
Also see:   disktoscrn fexist wintodisk
Example:
            if(disktowin("WINDOW.DAT")) {
                printf("Error reading input file\n");
                exit(1);
            }


Name:       emsalloc
Purpose:    allocates pages of EMS memory.  See the section on using TCXL's EMS
            functions for more information
Prototype:  unsigned emsalloc(int numpages);
Header:     tcxlems.h
Inputs:     numpages  - the number of pages (16K blocks) requested
Return:     the EMS handle or a 0 if an error occurred


                                      19   
Also see:   emsdealloc emsexist emsfree
Example:
            int handle1;
            handle1=emsalloc(2);        /*  request 2 pages (32K)   */
            if(!handle1) {
                printf("EMS allocation error\n");
                exit(1);
            }


Name:       emsdealloc
Purpose:    deallocate previously allocated pages of EMS memory
Prototype:  int emsdealloc(int handle);
Header:     tcxlems.h
Inputs:     handle  - the previously assigned EMS handle

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -