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

📄 wincreat.c

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 C
📖 第 1 页 / 共 2 页
字号:
/****************************************************************************
*
*                            Open Watcom Project
*
*    Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
*  ========================================================================
*
*    This file contains Original Code and/or Modifications of Original
*    Code as defined in and that are subject to the Sybase Open Watcom
*    Public License version 1.0 (the 'License'). You may not use this file
*    except in compliance with the License. BY USING THIS FILE YOU AGREE TO
*    ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
*    provided with the Original Code and Modifications, and is also
*    available at www.sybase.com/developer/opensource.
*
*    The Original Code and all software distributed under the License are
*    distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
*    EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
*    ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
*    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
*    NON-INFRINGEMENT. Please see the License for the specific language
*    governing rights and limitations under the License.
*
*  ========================================================================
*
* Description:  WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE
*               DESCRIBE IT HERE!
*
****************************************************************************/


#include "imgedit.h"
#include "ieclrpal.h"
#include "ieprofil.h"

/*
 * Win_CreateColourPal - windows version to create the colour palette
 */
void Win_CreateColourPal( void )
{
    char        *title;

    title = IEAllocRCString( WIE_COLORPALETTETITLE );
#ifndef __NT__
    HColourPalette = CreateWindow(
            PaletteClass,                       /* Window class name */
            title,
            WS_POPUPWINDOW | WS_CAPTION,        /* Window style */
            ImgedConfigInfo.pal_xpos,           /* Initial X position */
            ImgedConfigInfo.pal_ypos,           /* Initial Y position */
            CP_WIDTH+2,                         /* Initial X size */
            CP_HEIGHT+15,                       /* Initial Y size */
            HMainWindow,                        /* Parent window handle */
            (HMENU) NULL,                       /* Window menu handle */
            Instance,                           /* Program instance handle */
            NULL);                              /* Create parameters */
#else
    HColourPalette = CreateWindowEx(
            WS_EX_TOOLWINDOW,
            PaletteClass,                       /* Window class name */
            title,
            WS_POPUPWINDOW | WS_CAPTION,        /* Window style */
            ImgedConfigInfo.pal_xpos,           /* Initial X position */
            ImgedConfigInfo.pal_ypos,           /* Initial Y position */
            CP_WIDTH+2,                         /* Initial X size */
            CP_HEIGHT+15,                       /* Initial Y size */
            HMainWindow,                        /* Parent window handle */
            (HMENU) NULL,                       /* Window menu handle */
            Instance,                           /* Program instance handle */
            NULL);                              /* Create parameters */
#endif

    if( title ) {
        IEFreeRCString( title );
    }

    if( HColourPalette != (HWND)NULL ) {
        RECT    rect;
        int     w,h;
        _wpi_getclientrect( HColourPalette, &rect );
        w = _wpi_getwidthrect( rect );
        h = _wpi_getheightrect( rect );
        if( w < CP_WIDTH || h < CP_HEIGHT ) {
            GetWindowRect( HColourPalette, &rect );
            w = _wpi_getwidthrect( rect ) + ( CP_WIDTH - w );
            h = _wpi_getheightrect( rect ) + ( CP_HEIGHT - h );
            SetWindowPos( HColourPalette, HWND_TOP, 0, 0, w, h,
                          SWP_SIZE | SWP_NOZORDER | SWP_NOMOVE );
        }
    }

    SendMessage( HColourPalette, WM_SETFONT, (DWORD)SmallFont, 0L );
} /* Win_CreateColourPal */

/*
 * Win_CreateCurrentDisp - creates the current display window for the
 *                         windows version
 */
HWND Win_CreateCurrentDisp( HWND hparent )
{
    HWND        hwnd;

    hwnd = CreateWindow(
            CURRENT_CLASS,                      /* Window class name */
            "",
            WS_CHILD | WS_VISIBLE,              /* control styles       */
            CUR_WND_X,                          /* Initial X position */
            CUR_WND_Y,                          /* Initial Y position */
            CUR_WND_WIDTH,                      /* Initial X size */
            CUR_WND_HEIGHT,                     /* Initial Y size */
            hparent,                            /* Parent window handle */
            (HMENU)NULL,                        /* Window menu handle */
            Instance,                           /* Program instance handle */
            NULL);                              /* Create parameters */

    ShowWindow( hwnd, SW_NORMAL );
    UpdateWindow( hwnd );
    SendMessage( hwnd, WM_SETFONT, (DWORD) SmallFont, 0L );

    return( hwnd );
} /* Win_CreateCurrentDisp */

/*
 * Win_CreateColourCtrls - creates the controls in the colour palette for
 *                         windows version
 */
void Win_CreateColourCtrls( HWND hpar, HWND *colours, HWND *screenclrs,
                                        HWND *screentxt, HWND *inversetxt )
{
    HWND        hwnd1;
    HWND        hwnd2;
    char        *text;

    *colours = CreateWindow(
            AVAIL_CLASS,                        /* Window class name */
            "",
            WS_CHILD | WS_VISIBLE,              /* control styles       */
            COL_WND_X,                          /* Initial X position */
            COL_WND_Y,                          /* Initial Y position */
            COL_WND_WIDTH,                      /* Initial X size */
            COL_WND_HEIGHT,                     /* Initial Y size */
            hpar,                               /* Parent window handle */
            (HMENU)NULL,                        /* Window menu handle */
            Instance,                           /* Program instance handle */
            NULL);                              /* Create parameters */

    ShowWindow( *colours, SW_NORMAL );
    UpdateWindow( *colours );
    SendMessage( *colours, WM_SETFONT, (DWORD)SmallFont, 0L );

    *screenclrs = CreateWindow(
            SCREEN_CLASS,                       /* Window class name */
            "",
            WS_CHILD | WS_VISIBLE,              /* control styles       */
            SCRN_WND_X,                         /* Initial X position */
            SCRN_WND_Y,                         /* Initial Y position */
            SCRN_WND_WIDTH,                     /* Initial X size */
            SCRN_WND_HEIGHT,                    /* Initial Y size */
            hpar,                               /* Parent window handle */
            (HMENU)NULL,                        /* Window menu handle */
            Instance,                           /* Program instance handle */
            NULL);                              /* Create parameters */

    ShowWindow( *screenclrs, SW_HIDE );
    SendMessage( *screenclrs, WM_SETFONT, (DWORD)SmallFont, 0L );

    hwnd1 = CreateWindow(
            "STATIC",                           /* Window class name */
            "",
            SS_RIGHT | WS_CHILD | WS_VISIBLE,   /* control styles       */
            TEXT1X,                             /* Initial X position */
            TEXT1Y,                             /* Initial Y position */
            TEXT_WIDTH,                         /* Initial X size */
            TEXTHEIGHT,                         /* Initial Y size */
            hpar,                               /* Parent window handle */
            (HMENU)NULL,                        /* Window menu handle */
            Instance,                           /* Program instance handle */
            NULL);                              /* Create parameters */

    ShowWindow( hwnd1, SW_NORMAL );
    UpdateWindow( hwnd1 );
    SendMessage( hwnd1, WM_SETFONT, (DWORD) SmallFont, 0L );

    hwnd2 = CreateWindow(
            "STATIC",                           /* Window class name */
            "",
            SS_RIGHT | WS_CHILD | WS_VISIBLE,   /* control styles       */
            TEXT1X,                             /* Initial X position */
            TEXT2Y,                             /* Initial Y position */
            TEXT_WIDTH,                         /* Initial X size */
            TEXTHEIGHT,                         /* Initial Y size */
            hpar,                               /* Parent window handle */
            (HMENU)NULL,                        /* Window menu handle */
            Instance,                           /* Program instance handle */
            NULL);                              /* Create parameters */

    ShowWindow( hwnd2, SW_NORMAL );
    UpdateWindow( hwnd2 );
    SendMessage( hwnd2, WM_SETFONT, (DWORD) SmallFont, 0L );

    *screentxt = CreateWindow(
            "STATIC",                   /* Window class name */
            "",
            SS_RIGHT | WS_CHILD | WS_VISIBLE,   /* control styles       */
            LINE1X,                             /* Initial X position */
            LINE1Y,                             /* Initial Y position */
            LINE_WIDTH,                         /* Initial X size */
            TEXTHEIGHT,                         /* Initial Y size */
            hpar,                               /* Parent window handle */
            (HMENU)NULL,                        /* Window menu handle */
            Instance,                           /* Program instance handle */
            NULL);                              /* Create parameters */

⌨️ 快捷键说明

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