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

📄 listedit_private.h

📁 在uc_GUI中增加的列表编辑框list_edit源代码
💻 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        : LISTEDIT_Private.h
Purpose     : Private LISTEDIT include
--------------------END-OF-HEADER-------------------------------------
modify by fzz 20060119
*/

#ifndef LISTEDIT_PRIVATE_H
#define LISTEDIT_PRIVATE_H

#include "WM.h"
#include "LISTEDIT.h"
#include "GUI_ARRAY.h"

#if GUI_WINSUPPORT

/*********************************************************************
*
*       Macros for internal use
*
**********************************************************************
*/

#ifndef	LISTEDIT_EDIT_MAXLEN
	#define	LISTEDIT_EDIT_MAXLEN	12
#else
	#if LISTEDIT_EDIT_MAXLEN > 30
		#undef LISTEDIT_EDIT_MAXLEN
		#define	LISTEDIT_EDIT_MAXLEN 30
	#endif
#endif


#define LISTEDIT_ID 0x4568   /* Magic numer, should be unique if possible */

#define LISTEDIT_H2P(h) (LISTEDIT_Obj*) WM_H2P(h)

#if GUI_DEBUG_LEVEL > 1
  #define LISTEDIT_ASSERT_IS_VALID_PTR(p) DEBUG_ERROROUT_IF(p->DebugId != LISTEDIT_ID, "xxx.c: Wrong handle type or Object not init'ed")
  #define LISTEDIT_INIT_ID(p)   p->DebugId = LISTEDIT_ID
  #define LISTEDIT_DEINIT_ID(p) p->DebugId = LISTEDIT_ID+1
#else
  #define LISTEDIT_ASSERT_IS_VALID_PTR(p)
  #define LISTEDIT_INIT_ID(p)
  #define LISTEDIT_DEINIT_ID(p)
#endif

/*********************************************************************
*
*       Object definition
*
**********************************************************************
*/

typedef struct {
  GUI_COLOR aBkColor[4];
  GUI_COLOR aTextColor[4];
} LISTEDIT_ITEM_INFO;

typedef struct {
  WM_HMEM hItemInfo;
  char acText[1];
} LISTEDIT_ITEM;

typedef struct {
  GUI_COLOR                    aBkColor[4];
  GUI_COLOR                    aTextColor[4];
  GUI_COLOR                    GridColor;
  const GUI_FONT GUI_UNI_PTR * pFont;
} LISTEDIT_PROPS;

typedef struct {
  WIDGET          Widget;
  HEADER_Handle   hHeader;
  GUI_ARRAY       RowArray;         /* One entry per line. Every entry is a handle of GUI_ARRAY of strings */
  GUI_ARRAY       AlignArray;       /* One entry per column */
  LISTEDIT_PROPS  Props;
  int             RowSel;
  int			  ColSel;	
  int             ShowGrid;
  unsigned        RowDistY;
  unsigned        LBorder;
  unsigned        RBorder;
  WM_SCROLL_STATE ScrollStateV;
  WM_SCROLL_STATE ScrollStateH;
  WM_HWIN         hOwner;
  char			  CurString[30];
  #if GUI_DEBUG_LEVEL > 1
    int DebugId;
  #endif  
} LISTEDIT_Obj;

/*********************************************************************
*
*       Private (module internal) data
*
**********************************************************************
*/

extern LISTEDIT_PROPS LISTEDIT_DefaultProps;

/*********************************************************************
*
*       Private (module internal) functions
*
**********************************************************************
*/
int      LISTEDIT__UpdateScrollParas   (LISTEDIT_Handle hObj, LISTEDIT_Obj* pObj);
void     LISTEDIT__InvalidateInsideArea(LISTEDIT_Handle hObj, LISTEDIT_Obj* pObj);
unsigned LISTEDIT__GetRowDistY         (const LISTEDIT_Obj* pObj);
unsigned LISTEDIT__GetColDistX         (const LISTEDIT_Obj* pObj,int col);
void     LISTEDIT__InvalidateRow       (LISTEDIT_Handle hObj, LISTEDIT_Obj* pObj, int RowSel);
void     LISTEDIT__InvalidateCol       (LISTEDIT_Handle hObj, LISTEDIT_Obj* pObj, int ColSel);
int      LISTEDIT__UpdateScrollPos     (LISTEDIT_Handle hObj, LISTEDIT_Obj* pObj, int row);

#endif /* GUI_WINSUPPORT */

#else                            /* Avoid problems with empty object modules */
  void LISTEDIT_C(void) {}
#endif

/*************************** End of file ****************************/

⌨️ 快捷键说明

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