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

📄 framewin.h

📁 基于嵌入式实时多任务操作系统ucos-ii的GUI的源码
💻 H
字号:
/*
*********************************************************************************************************
*                                                uC/GUI
*                        Universal graphic software for embedded applications
*
*                       (c) Copyright 2002, Micrium Inc., Weston, FL
*                       (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH
*
*              礐/GUI is protected by international copyright laws. Knowledge of the
*              source code may not be used to write a similar product. This file may
*              only be used in accordance with a license and should not be redistributed
*              in any way. We appreciate your understanding and fairness.
*
----------------------------------------------------------------------
File        : FRAMEWIN.h
Purpose     : Frame window include
--------------------END-OF-HEADER-------------------------------------
*/

#ifndef FRAMEWIN_H
#define FRAMEWIN_H

#include "WM.h"
#if GUI_WINSUPPORT
#include "DIALOG.h"      /* Req. for Create indirect data structure */


/************************************************************
*
*       #defines
*
*************************************************************
*/
/************************************************************
*
*       Create / Status flags
*/
#define FRAMEWIN_CF_MOVEABLE   (1<<4)
#define FRAMEWIN_SF_MOVEABLE   (1<<4)
#define FRAMEWIN_SF_TITLEVIS   (1<<5)
#define FRAMEWIN_SF_MINIMIZED  (1<<6)
#define FRAMEWIN_SF_MAXIMIZED  (1<<7)

/************************************************************
*
*       BUTTON Flags
*/

#define FRAMEWIN_BUTTON_RIGHT  (1<<0)

/************************************************************
*                                                           *
*                         Types                             *
*                                                           *
*************************************************************
*/

typedef WM_HMEM FRAMEWIN_Handle;

/*********************************************************************
*
*       Create functions
*
**********************************************************************
*/
FRAMEWIN_Handle FRAMEWIN_Create        (const char* pTitle, WM_CALLBACK* cb, int Flags,
                                        int x0, int y0, int xsize, int ysize);
FRAMEWIN_Handle FRAMEWIN_CreateAsChild (int x0, int y0, int xsize, int ysize, WM_HWIN hParent,
                                        const char* pText, WM_CALLBACK* cb, int Flags);
FRAMEWIN_Handle FRAMEWIN_CreateIndirect(const GUI_WIDGET_CREATE_INFO* pCreateInfo, 
                                        WM_HWIN hWinParent, int x0, int y0, 
                                        WM_CALLBACK* cb);

/*********************************************************************
*
*       Standard member functions
*
**********************************************************************
*/
#define FRAMEWIN_EnableMemdev(hObj)  WM_EnableMemdev(hObj)
#define FRAMEWIN_DisableMemdev(hObj) WM_DisableMemdev(hObj)
#define FRAMEWIN_Delete(hObj)        WM_DeleteWindow(hObj)
#define FRAMEWIN_Paint(hObj)         WM_Paint(hObj)
#define FRAMEWIN_Invalidate(hObj)    WM_InvalidateWindow(hObj)

WM_HWIN FRAMEWIN_CreateButton     (FRAMEWIN_Handle hObj, int Flags, int Off, int Id);
WM_HWIN FRAMEWIN_CreateCloseButton(FRAMEWIN_Handle hObj, int Flags, int Off);
WM_HWIN FRAMEWIN_CreateMaxButton  (FRAMEWIN_Handle hObj, int Flags, int Off);
WM_HWIN FRAMEWIN_CreateMinButton  (FRAMEWIN_Handle hObj, int Flags, int Off);

void    FRAMEWIN_Minimize      (FRAMEWIN_Handle hObj);
void    FRAMEWIN_Maximize      (FRAMEWIN_Handle hObj);
void    FRAMEWIN_Restore       (FRAMEWIN_Handle hObj);

/*********************************************************************
*
*       Member functions: Set Properties
*
**********************************************************************
*/
void          FRAMEWIN_SetActive      (FRAMEWIN_Handle hObj, int State);
void          FRAMEWIN_SetBarColor    (FRAMEWIN_Handle pObj, int index, GUI_COLOR color);
void          FRAMEWIN_SetClientColor (FRAMEWIN_Handle hObj, GUI_COLOR Color);
void          FRAMEWIN_SetFont        (FRAMEWIN_Handle pObj, const GUI_FONT* pFont);
void          FRAMEWIN_SetMoveable    (FRAMEWIN_Handle hObj, int State);
void          FRAMEWIN_SetText        (FRAMEWIN_Handle pObj, const char* s);
void          FRAMEWIN_SetTextAlign   (FRAMEWIN_Handle pObj, int Align);
void          FRAMEWIN_SetTextColor   (FRAMEWIN_Handle pObj, GUI_COLOR color);
void          FRAMEWIN_SetTextPos     (FRAMEWIN_Handle pObj, int XOff, int YOff);
void          FRAMEWIN_SetTitleVis    (FRAMEWIN_Handle hObj, int Show);
int           FRAMEWIN_SetTitleHeight (FRAMEWIN_Handle hObj, int Height);

/*********************************************************************
*
*       Member functions: Get Properties
*
**********************************************************************
*/
int FRAMEWIN_GetTitleHeight(FRAMEWIN_Handle hObj);
int FRAMEWIN_GetBorderSize(FRAMEWIN_Handle hObj);

/*********************************************************************
*
*       Global functions
*
**********************************************************************
*/
GUI_COLOR       FRAMEWIN_GetDefaultBarColor   (int Index);
int             FRAMEWIN_GetDefaultBorderSize (void);
int             FRAMEWIN_GetDefaultTitleHeight(void);
GUI_COLOR       FRAMEWIN_GetDefaultClientColor(void);
const GUI_FONT* FRAMEWIN_GetDefaultFont       (void);
void            FRAMEWIN_SetDefaultBarColor   (int Index, GUI_COLOR Color);
void            FRAMEWIN_SetDefaultBorderSize (int DefaultBorderSize);
void            FRAMEWIN_SetDefaultTitleHeight(int DefaultTitleHeight);
void            FRAMEWIN_SetDefaultClientColor(GUI_COLOR Color);
void            FRAMEWIN_SetDefaultFont       (const GUI_FONT* pFont);

/*********************************************************************
*
*       Macros for compatibility
*
**********************************************************************
*/
#define         FRAMEWIN_SetDefaultCaptionSize(Height) FRAMEWIN_SetDefaultTitleHeight(Height)
#define         FRAMEWIN_GetDefaultCaptionSize()       FRAMEWIN_GetDefaultTitleHeight()

#endif
#endif   /* FRAMEWIN_H */

⌨️ 快捷键说明

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