亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tkwinbutton.c

?? NS2網絡仿真軟件是目前最為流行的網絡仿真模擬軟件
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*  * tkWinButton.c -- * *	This file implements the Windows specific portion of the button *	widgets. * * Copyright (c) 1996-1998 by Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * RCS: @(#) $Id: tkWinButton.c,v 1.20.2.3 2003/10/10 00:03:57 hobbs Exp $ */#define OEMRESOURCE#include "tkWinInt.h"#include "tkButton.h"/* * These macros define the base style flags for the different button types. */#define LABEL_STYLE (BS_OWNERDRAW | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS)#define PUSH_STYLE (BS_OWNERDRAW | BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS)#define CHECK_STYLE (BS_OWNERDRAW | BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS)#define RADIO_STYLE (BS_OWNERDRAW | BS_RADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS)/* * Declaration of Windows specific button structure. */typedef struct WinButton {    TkButton info;		/* Generic button info. */    WNDPROC oldProc;		/* Old window procedure. */    HWND hwnd;			/* Current window handle. */    Pixmap pixmap;		/* Bitmap for rendering the button. */    DWORD style;		/* Window style flags. */} WinButton;/* * The following macro reverses the order of RGB bytes to convert * between RGBQUAD and COLORREF values. */#define FlipColor(rgb) (RGB(GetBValue(rgb),GetGValue(rgb),GetRValue(rgb)))/* * The following enumeration defines the meaning of the palette entries * in the "buttons" image used to draw checkbox and radiobutton indicators. */enum {    PAL_CHECK = 0,    PAL_TOP_OUTER = 1,    PAL_BOTTOM_OUTER = 2,    PAL_BOTTOM_INNER = 3,    PAL_INTERIOR = 4,    PAL_TOP_INNER = 5,    PAL_BACKGROUND = 6};/* * Cached information about the boxes bitmap, and the default border  * width for a button in string form for use in Tk_OptionSpec for  * the various button widget classes. */typedef struct ThreadSpecificData {     BITMAPINFOHEADER *boxesPtr;   /* Information about the bitmap. */    DWORD *boxesPalette;	  /* Pointer to color palette. */    LPSTR boxesBits;		  /* Pointer to bitmap data. */    DWORD boxHeight;              /* Height of each sub-image. */    DWORD boxWidth ;              /* Width of each sub-image. */    char defWidth[TCL_INTEGER_SPACE];} ThreadSpecificData;static Tcl_ThreadDataKey dataKey;/* * Declarations for functions defined in this file. */static LRESULT CALLBACK	ButtonProc _ANSI_ARGS_((HWND hwnd, UINT message,			    WPARAM wParam, LPARAM lParam));static Window		CreateProc _ANSI_ARGS_((Tk_Window tkwin,			    Window parent, ClientData instanceData));static void		InitBoxes _ANSI_ARGS_((void));/* * The class procedure table for the button widgets. */Tk_ClassProcs tkpButtonProcs = {     sizeof(Tk_ClassProcs),	/* size */    TkButtonWorldChanged,	/* worldChangedProc */    CreateProc,			/* createProc */};/* *---------------------------------------------------------------------- * * InitBoxes -- * *	This function load the Tk 3d button bitmap.  "buttons" is a 16  *	color bitmap that is laid out such that the top row contains  *	the 4 checkbox images, and the bottom row contains the radio  *	button images. Note that the bitmap is stored in bottom-up  *	format.  Also, the first seven palette entries are used to  *	identify the different parts of the bitmaps so we can do the  *	appropriate color mappings based on the current button colors. * * Results: *	None. * * Side effects: *	Loads the "buttons" resource. * *---------------------------------------------------------------------- */static voidInitBoxes(){    /*     * For DLLs like Tk, the HINSTANCE is the same as the HMODULE.     */    HMODULE module = (HINSTANCE) Tk_GetHINSTANCE();    HRSRC hrsrc;    HGLOBAL hblk;    LPBITMAPINFOHEADER newBitmap;    DWORD size;    ThreadSpecificData *tsdPtr = (ThreadSpecificData *)             Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));    hrsrc = FindResource(module, "buttons", RT_BITMAP);    if (hrsrc) {	hblk = LoadResource(module, hrsrc);	tsdPtr->boxesPtr = (LPBITMAPINFOHEADER)LockResource(hblk);    }    /*     * Copy the DIBitmap into writable memory.     */    if (tsdPtr->boxesPtr != NULL && !(tsdPtr->boxesPtr->biWidth % 4)	    && !(tsdPtr->boxesPtr->biHeight % 2)) {	size = tsdPtr->boxesPtr->biSize + (1 << tsdPtr->boxesPtr->biBitCount)                 * sizeof(RGBQUAD) + tsdPtr->boxesPtr->biSizeImage;	newBitmap = (LPBITMAPINFOHEADER) ckalloc(size);	memcpy(newBitmap, tsdPtr->boxesPtr, size);	tsdPtr->boxesPtr = newBitmap;	tsdPtr->boxWidth = tsdPtr->boxesPtr->biWidth / 4;	tsdPtr->boxHeight = tsdPtr->boxesPtr->biHeight / 2;	tsdPtr->boxesPalette = (DWORD*) (((LPSTR) tsdPtr->boxesPtr)                 + tsdPtr->boxesPtr->biSize);	tsdPtr->boxesBits = ((LPSTR) tsdPtr->boxesPalette)	    + ((1 << tsdPtr->boxesPtr->biBitCount) * sizeof(RGBQUAD));    } else {	tsdPtr->boxesPtr = NULL;    }}/* *---------------------------------------------------------------------- * * TkpButtonSetDefaults -- * *	This procedure is invoked before option tables are created for *	buttons.  It modifies some of the default values to match the *	current values defined for this platform. * * Results: *	Some of the default values in *specPtr are modified. * * Side effects: *	Updates some of. * *---------------------------------------------------------------------- */voidTkpButtonSetDefaults(specPtr)    Tk_OptionSpec *specPtr;	/* Points to an array of option specs,				 * terminated by one with type				 * TK_OPTION_END. */{    int width;    ThreadSpecificData *tsdPtr = (ThreadSpecificData *)             Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));    if (tsdPtr->defWidth[0] == 0) {	width = GetSystemMetrics(SM_CXEDGE);	if (width == 0) {	    width = 1;	}	sprintf(tsdPtr->defWidth, "%d", width);    }    for ( ; specPtr->type != TK_OPTION_END; specPtr++) {	if (specPtr->internalOffset == Tk_Offset(TkButton, borderWidth)) {	    specPtr->defValue = tsdPtr->defWidth;	}    }}/* *---------------------------------------------------------------------- * * TkpCreateButton -- * *	Allocate a new TkButton structure. * * Results: *	Returns a newly allocated TkButton structure. * * Side effects: *	Registers an event handler for the widget. * *---------------------------------------------------------------------- */TkButton *TkpCreateButton(tkwin)    Tk_Window tkwin;{    WinButton *butPtr;    butPtr = (WinButton *)ckalloc(sizeof(WinButton));    butPtr->hwnd = NULL;    return (TkButton *) butPtr;}/* *---------------------------------------------------------------------- * * CreateProc -- * *	This function creates a new Button control, subclasses *	the instance, and generates a new Window object. * * Results: *	Returns the newly allocated Window object, or None on failure. * * Side effects: *	Causes a new Button control to come into existence. * *---------------------------------------------------------------------- */static WindowCreateProc(tkwin, parentWin, instanceData)    Tk_Window tkwin;		/* Token for window. */    Window parentWin;		/* Parent of new window. */    ClientData instanceData;	/* Button instance data. */{    Window window;    HWND parent;    char *class;    WinButton *butPtr = (WinButton *)instanceData;    parent = Tk_GetHWND(parentWin);    if (butPtr->info.type == TYPE_LABEL) {	class = "STATIC";	butPtr->style = SS_OWNERDRAW | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS;    } else {	class = "BUTTON";	butPtr->style = BS_OWNERDRAW | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS;    }    butPtr->hwnd = CreateWindow(class, NULL, butPtr->style,	    Tk_X(tkwin), Tk_Y(tkwin), Tk_Width(tkwin), Tk_Height(tkwin),	    parent, NULL, Tk_GetHINSTANCE(), NULL);    SetWindowPos(butPtr->hwnd, HWND_TOP, 0, 0, 0, 0,		    SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);#ifdef _WIN64    butPtr->oldProc = (WNDPROC)SetWindowLongPtr(butPtr->hwnd, GWLP_WNDPROC,	    (LONG_PTR) ButtonProc);#else    butPtr->oldProc = (WNDPROC)SetWindowLong(butPtr->hwnd, GWL_WNDPROC,	    (DWORD) ButtonProc);#endif    window = Tk_AttachHWND(tkwin, butPtr->hwnd);    return window;}/* *---------------------------------------------------------------------- * * TkpDestroyButton -- * *	Free data structures associated with the button control. * * Results: *	None. * * Side effects: *	Restores the default control state. * *---------------------------------------------------------------------- */voidTkpDestroyButton(butPtr)    TkButton *butPtr;{    WinButton *winButPtr = (WinButton *)butPtr;    HWND hwnd = winButPtr->hwnd;    if (hwnd) {#ifdef _WIN64	SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) winButPtr->oldProc);#else	SetWindowLong(hwnd, GWL_WNDPROC, (DWORD) winButPtr->oldProc);#endif    }}/* *---------------------------------------------------------------------- * * TkpDisplayButton -- * *	This procedure is invoked to display a button widget.  It is *	normally invoked as an idle handler. * * Results: *	None. * * Side effects: *	Information appears on the screen.  The REDRAW_PENDING flag *	is cleared. * *---------------------------------------------------------------------- */voidTkpDisplayButton(clientData)    ClientData clientData;	/* Information about widget. */{    TkWinDCState state;    HDC dc;    register TkButton *butPtr = (TkButton *) clientData;    GC gc;    Tk_3DBorder border;    Pixmap pixmap;    int x = 0;			/* Initialization only needed to stop				 * compiler warning. */    int y, relief;    register Tk_Window tkwin = butPtr->tkwin;    int width=0, height=0, haveImage = 0, haveText = 0, drawRing = 0;    RECT rect;    int defaultWidth;		/* Width of default ring. */    int offset;			/* 0 means this is a label widget.  1 means				 * it is a flavor of button, so we offset				 * the text to make the button appear to				 * move up and down as the relief changes. */    int textXOffset = 0, textYOffset = 0; /* text offsets for use with					   * compound buttons and focus ring */    int imageWidth=0, imageHeight=0;    int imageXOffset = 0, imageYOffset = 0; /* image information that will					     * be used to restrict disabled					     * pixmap as well */    DWORD *boxesPalette;    ThreadSpecificData *tsdPtr = (ThreadSpecificData *)             Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));    boxesPalette= tsdPtr->boxesPalette;    butPtr->flags &= ~REDRAW_PENDING;    if ((butPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {	return;    }    border = butPtr->normalBorder;    if ((butPtr->state == STATE_DISABLED) && (butPtr->disabledFg != NULL)) {	gc = butPtr->disabledGC;    } else if ((butPtr->state == STATE_ACTIVE)	    && !Tk_StrictMotif(butPtr->tkwin)) {	gc = butPtr->activeTextGC;	border = butPtr->activeBorder;    } else {	gc = butPtr->normalTextGC;    }    if ((butPtr->flags & SELECTED) && (butPtr->state != STATE_ACTIVE)	    && (butPtr->selectBorder != NULL) && !butPtr->indicatorOn) {	border = butPtr->selectBorder;    }    /*     * Override the relief specified for the button if this is a     * checkbutton or radiobutton and there's no indicator.  The new     * relief is as follows:     *      If the button is select  --> "sunken"     *      If relief==overrelief    --> relief     *      Otherwise                --> overrelief     *     * The effect we are trying to achieve is as follows:     *     *      value    mouse-over?   -->   relief     *     -------  ------------        --------     *       off        no               flat     *       off        yes              raised     *       on         no               sunken     *       on         yes              sunken     *     * This is accomplished by configuring the checkbutton or radiobutton     * like this:     *     *     -indicatoron 0 -overrelief raised -offrelief flat     *     * Bindings (see library/button.tcl) will copy the -overrelief into

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产99精品视频| 亚洲色图欧洲色图| 九九视频精品免费| 精品国产91久久久久久久妲己| 人人狠狠综合久久亚洲| 这里只有精品免费| 日韩av中文在线观看| 欧美第一区第二区| 国产麻豆成人传媒免费观看| 国产欧美久久久精品影院| 波多野结衣亚洲一区| 一区二区三区视频在线看| 欧美日韩精品一二三区| 免费在线一区观看| 国产欧美精品在线观看| 色综合久久88色综合天天| 午夜精品久久久久久久久久| 日韩欧美一级特黄在线播放| 国产成人综合网站| 亚洲精品中文在线观看| 制服丝袜亚洲网站| 国产激情一区二区三区| 亚洲六月丁香色婷婷综合久久| 欧美色综合网站| 黑人巨大精品欧美黑白配亚洲| 国产精品久久久久精k8| 欧美日韩激情一区| 国产一二精品视频| 亚洲精品大片www| 日韩欧美国产一区在线观看| 成人av电影观看| 首页国产丝袜综合| 中文字幕成人网| 欧美电影在线免费观看| 国产凹凸在线观看一区二区| 亚洲国产日韩a在线播放| 久久亚洲捆绑美女| 欧美在线不卡视频| 国产福利一区在线| 丝袜美腿亚洲综合| 国产精品美女久久久久av爽李琼 | 亚洲va韩国va欧美va| 久久婷婷成人综合色| 欧美午夜宅男影院| 成人高清视频在线观看| 午夜精品福利在线| 中文字幕二三区不卡| 日韩欧美国产麻豆| 欧美日韩在线免费视频| 成人激情校园春色| 国产在线国偷精品产拍免费yy| 亚洲在线中文字幕| 综合久久一区二区三区| 国产午夜三级一区二区三| 在线不卡一区二区| 在线观看日韩精品| 91麻豆高清视频| 成人午夜激情影院| 国内精品第一页| 老司机午夜精品99久久| 亚洲成人免费av| 樱桃国产成人精品视频| 国产精品久久久久aaaa| 国产日韩欧美麻豆| 亚洲精品一区二区三区99| 制服丝袜成人动漫| 欧美三级日韩三级| 在线区一区二视频| 色综合天天狠狠| 99久免费精品视频在线观看| 国产成人99久久亚洲综合精品| 久久国产麻豆精品| 捆绑调教美女网站视频一区| 丝袜脚交一区二区| 午夜精品久久久久影视| 亚洲福利视频一区二区| 亚洲卡通动漫在线| 一区二区三区成人在线视频| 亚洲欧美aⅴ...| 亚洲日本免费电影| 亚洲精品视频在线| 亚洲中国最大av网站| 亚洲国产成人av网| 婷婷一区二区三区| 日本欧美肥老太交大片| 麻豆精品一区二区| 久久国产夜色精品鲁鲁99| 国内精品写真在线观看| 国产精品自拍网站| 成人综合婷婷国产精品久久免费| 福利电影一区二区三区| caoporen国产精品视频| 色噜噜狠狠成人网p站| 在线亚洲高清视频| 欧美日韩激情一区二区| 日韩欧美国产不卡| 久久精品视频一区二区| 国产精品免费av| 亚洲黄网站在线观看| 亚洲h在线观看| 看电影不卡的网站| 国产99一区视频免费 | 奇米一区二区三区| 九一久久久久久| 丁香网亚洲国际| 色国产综合视频| 91精品国产乱| 欧美激情一区二区三区蜜桃视频| 亚洲色图清纯唯美| 日本午夜一区二区| 成人午夜又粗又硬又大| 欧美在线一区二区| 精品少妇一区二区三区| 中文字幕在线不卡视频| 丝袜亚洲另类欧美| 高清国产午夜精品久久久久久| 99精品久久只有精品| 欧美狂野另类xxxxoooo| 久久午夜老司机| 一区二区三区中文字幕| 久久99国内精品| 91在线视频观看| 日韩一区二区三区免费看| 日本一区二区高清| 天天亚洲美女在线视频| 粉嫩av一区二区三区在线播放| 在线日韩一区二区| 久久久五月婷婷| 五月婷婷综合网| 波多野结衣中文字幕一区二区三区| 欧美性大战久久久久久久| 精品成人a区在线观看| 一区二区三区日韩精品| 国产精品综合av一区二区国产馆| 欧美艳星brazzers| 国产蜜臀97一区二区三区 | 中文字幕在线不卡一区二区三区| 日韩电影免费一区| 91久久国产综合久久| 国产日韩欧美一区二区三区乱码 | 欧美视频在线一区二区三区| 国产午夜精品福利| 蜜臀av国产精品久久久久| 欧美综合亚洲图片综合区| 国产欧美精品一区二区色综合朱莉| 日韩av一二三| 欧美性受xxxx黑人xyx性爽| 国产女同性恋一区二区| 蜜臀久久久久久久| 欧美视频一区二区三区| 日韩美女啊v在线免费观看| 国产精品亚洲人在线观看| 日韩一级片在线播放| 午夜激情久久久| 在线观看亚洲一区| 亚洲欧洲中文日韩久久av乱码| 国产91在线|亚洲| 国产三级精品在线| 国产精品一区二区黑丝| 欧美成人a视频| 日本美女一区二区三区| 欧美美女bb生活片| 亚洲电影你懂得| 欧美日韩综合不卡| 亚洲一区二区三区不卡国产欧美| 色综合天天狠狠| 亚洲久本草在线中文字幕| 99re66热这里只有精品3直播 | 天堂久久久久va久久久久| 欧美在线观看视频在线| 亚洲综合激情另类小说区| 日本道精品一区二区三区| 亚洲黄色免费电影| 欧美在线观看视频在线| 亚洲国产日韩综合久久精品| 在线视频一区二区三| 亚洲成人综合视频| 在线播放视频一区| 久久成人精品无人区| 久久久精品国产99久久精品芒果| 国产麻豆视频一区二区| 国产欧美日韩久久| 95精品视频在线| 亚洲一区二区三区在线看| 在线成人午夜影院| 麻豆国产91在线播放| 国产亚洲欧美中文| 成人av免费网站| 亚洲主播在线观看| 91精品欧美综合在线观看最新| 老司机精品视频一区二区三区| 久久免费精品国产久精品久久久久| 国产激情一区二区三区| 最新热久久免费视频| 欧美日韩国产不卡| 韩国午夜理伦三级不卡影院| 欧美国产成人在线| 欧美日韩综合色| 国产麻豆一精品一av一免费| 日韩毛片精品高清免费|