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

📄 uioptns.src

📁 Dos6.0
💻 SRC
📖 第 1 页 / 共 2 页
字号:
/***
*uioptn.c - Support Options menu items.
*
*	Copyright <C> 1985-1988, Microsoft Corporation
*
*Purpose:
*	All Options menu support routines, and other routines that modify
*	the screen's appearance.
*
*******************************************************************************/

/* First, include version definition header */
#include <version.h>

/* Next, include TextWin's interface headers */
#include <cw/version.h>
#include <cw/windows.h>
#include <cw/edityp.h>
#include <cw/color.h>
#include <uiext.h>

/* include dialog information */
#include <cw/dlg.h>
#include "uioptns.hs"
#include "uioptns.sdm"

/* Next, include QBI's headers */
#ifndef CONTEXT_H
#include <context.h>
#endif

#ifndef QBIMSGS_H
#include <qbimsgs.h>
#endif

#ifndef UI_H
#include <ui.h>
#endif

#ifndef UIINT_H
#include <uiint.h>
#endif

#ifndef UTIL_H
#include <util.h>
#endif

#ifndef RTPS_H					/* [10] */
#include <rtps.h>				/* [10] */
#endif						/* [10] */

#ifndef HEAP_H					/* [10] */
#include <heap.h>				/* [10] */
#endif						/* [10] */

void near ColorResolution (void);		// [36]


void near SetFullMenus(void);

/* options have been changed with CmdViewOptions => write qb ini file */
boolean fOptionsChanged;
bool fSyntaxCheck = TRUE;  /* enabled by default */

BYTE fMono = FALSE;		// [25]

/********* View Options ******************************************************/

uchar rgMsgColors[] = {		//[30] change from word to byte
    MSG_Black,
    MSG_Blue,
    MSG_Green,
    MSG_Cyan,
    MSG_Red,
    MSG_Magenta,
    MSG_Brown,
    MSG_White,
    MSG_Gray,		/* [9] Add Bright colors */
    MSG_BrBlue, 	/* [9] */
    MSG_BrGreen,	/* [9] */
    MSG_BrCyan, 	/* [9] */
    MSG_BrRed,		/* [9] */
    MSG_Pink,		/* [9] */
    MSG_Yellow, 	/* [9] */
    MSG_BrWhite 	/* [9] */
};
#define	rgMsgColorsMax	(sizeof (rgMsgColors) / sizeof (BYTE))	//[30]

/* [9] Separate array is smaller than moving array around */
uchar rgMsgMono[] = {		//[30] change from word to byte
    MSG_Black,
    MSG_White,
    MSG_Gray,
    MSG_BrWhite
};
#define	rgMsgMonoMax	(sizeof (rgMsgMono) / sizeof (BYTE))	//[30]


/***
*WORD FAR WListProcColor (tmm, sz, isz, tmc, wParam, bArg)
*Purpose:
*	ListBox filling support procedure.
*
*Entry:
*	tmm		Dialog item message type.
*	sz		String pointer to return text in.
*	isz		Listbox item to return text for.
*	tmc		Unreferenced.
*	wParam		Unreferenced.
*	bArg		Unreferenced.
*
*Exit:
*	tmm = tmmCount, size of array of colors.
*	      tmmText or
*	      tmmEditText, Text of isz'th element of color array in sz.
*
*Exceptions:
*	None.
*******************************************************************************/
WORD FAR
WListProcColor (tmm, sz, isz, tmc, wParam, bArg)
WORD tmm;
char *sz;
WORD isz;
TMC tmc;
WORD wParam, bArg;
{
    Unreferenced (tmc);
    Unreferenced (wParam);
    Unreferenced (bArg);

    switch (tmm) {
	case tmmCount:
	    /* [5] [25] if fMono, use rgMsgMono */
	    return ((fMono ? rgMsgMonoMax : rgMsgColorsMax)	// [30]
		    >> ((cmdSwitches & CMD_SW_NOH) != 0)	// [21]
		   );

	case tmmText:
	case tmmEditText:
	    {
	    /* [5] [25] if fMono, use rgMsgMono */
	    DbAssert (fMono ? (isz<rgMsgMonoMax) : (isz<rgMsgColorsMax)); //[30]
	    ListStdMsg (fMono ? rgMsgMono[isz] : rgMsgColors[isz]);	//[30]
	    }
	    strcpy (sz, bufStdMsg);
	    break;
    }
    return (TRUE);		//[31] Was depending on return value of strcpy
				//[31] to be non-zero.
}



/* [7] Make MenuBarMain, rgMenuMain, and rgMenuMainEZ accessible */
extern MENUBAR MenuBarMain;
extern MENU rgMenuMain[], rgMenuMainEZ[];

/* [5] Array of colors for OptnsDisplay dialog */
static struct {
    WORD coFore, coBack;
} rgco[3];

/*** 
*BOOL FAR FDlgOptnsDisplay (dlm, tmc, wNew, wOld, wParam)
*Purpose:
*	Dialog procedure for dlgOptnsDisplay.
*
*	dlmInit:
*		Initialize the array of temporary colors for Normal Text,
*		Current Statement, and Breakpoint Line in rgco.
*
*	dlmClick:
*		If Changing foreground or background color, change
*		color array element, and redisplay the general picture
*		box for this element.
*
*		Else, get the color from the array, and change the
*		foreground and background listbox indices.
*
*Entry:
*	dlm		Dialog message.
*	tmc		Item code of action.
*	wNew		Unreferenced.
*	wOld		Unreferenced.
*	wParam		Unreferenced.
*
*Exit:
*	None.
*
*Exceptions:
*	None.
*******************************************************************************/
BOOL FAR
FDlgOptnsDisplay (dlm, tmc, wNew, wOld, wParam)
WORD dlm;
TMC tmc;
WORD wNew, wOld, wParam;
{
    ISA isa;
    register WORD oColor, i;
    WORD coFore, coBack;

    Unreferenced (wNew);
    Unreferenced (wOld);
    Unreferenced (wParam);

    if (dlm == dlmInit) {
	for (i = 0; i < 3; i++) {
	    GetIsaColor ((ISA) isaEditWindow+i, &rgco[i].coFore, &rgco[i].coBack);
	}
    }

    if (dlm == dlmInit || dlm == dlmClick) {
	oColor = (cmdSwitches & CMD_SW_ED) ? 0 : GetTmcVal (tmcColor);  //[38]
	DbAssert (oColor < 3);
	isa = (ISA) isaEditWindow + oColor;
	if (tmc == tmcCoFore || tmc == tmcCoBack) {
	    coFore = GetTmcVal (tmcCoFore);
	    coBack = GetTmcVal (tmcCoBack);
	    // [15] [25] If monochrome, translate index to attribute.
	    if (fMono) {
		rgco[oColor].coFore = ((coFore & 1) ? coWhite : coBlack) |
				      ((coFore >= 2) << 3);
		rgco[oColor].coBack = ((coBack & 1) ? coWhite : coBlack) |
				      ((coBack >= 2) << 3);
	    }
	    else {
		rgco[oColor].coFore = coFore;
		rgco[oColor].coBack = coBack;
	    }
            if (cmdSwitches & CMD_SW_ED)        //[38]
                RedisplayTmc (tmcQeditText);    //[38]
            else                                //[38]
	        RedisplayTmc (tmcNormalText + oColor);
	}
	else {
	    coFore = rgco[oColor].coFore;
	    coBack = rgco[oColor].coBack;
	    // [25] If no highlight bit, clear it for proper index
	    if (cmdSwitches & CMD_SW_NOH) {
		coFore &= 7;
		coBack &= 7;
	    }
	    // [15] [25] If monochrome, translate color to index.
	    if (fMono) {
		SetTmcVal (tmcCoFore, ((coFore & 7) == coWhite) |
				      ((coFore >= 8) << 1));
		SetTmcVal (tmcCoBack, ((coBack & 7) == coWhite) |
				      ((coBack >= 8) << 1));
	    }
	    else {
		SetTmcVal (tmcCoFore, coFore);
		SetTmcVal (tmcCoBack, coBack);
	   }
	}
    }

    return (TRUE);
}

#define QeditTextLen    [[UIOPTNS_1]]      //[38] length of " Set colors for the ",
                                           //[38]       and " text editor window:"
#define	ColoredTextLen	[[UIOPTNS_2]]	   //[12] length of " Normal Text       ",
				           //[12]           " Current Statement ",
				           //[12]       and " Breakpoint Lines  "

/***
*WORD FAR PASCAL DisplayQeditTextWndProc (tmm, pv, hObj, tmc, bArg, wParam)
*Purpose:
*	Display the the "QEDIT Text" color item in the appropriate color.
*
*Entry:
*	tmm		Unreferenced.
*	pv		pointer to general picture window.
*	hObj		Unreferenced.
*	tmc		Unreferenced.
*	bArg		Unreferenced.
*	wParam		Unreferenced.
*
*Exit:
*	returns TRUE.
*
*Exceptions:
*	None.
*******************************************************************************/
WORD FAR PASCAL
DisplayQeditTextWndProc (tmm, pv, hObj, tmc, bArg, wParam)      //[38]
TMM	tmm;
char *	pv;		/* really a pwnd */
WORD	hObj, bArg;	/* not used */
TMC	tmc;
WORD	wParam;
{
    REG1 PWND pwnd = (PWND) pv;

    Unreferenced (tmm);
    Unreferenced (hObj);
    Unreferenced (bArg);
    Unreferenced (tmc);
    Unreferenced (wParam);

⌨️ 快捷键说明

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