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

📄 uiviewport.h

📁 嵌入工linux开发的源码
💻 H
字号:
#ifndef _UIVIEWPORT_H
#define _UIVIEWPORT_H

#include <pr2k.h>
#include <typedefine.h>
#include <uigui_cfg.h>
#include <uicontrol.h>

#include <kernel/linklist.h>

/**************************************************************
	Viewport style
**************************************************************/
#define VPORT_DEFAULT_STYLE		0

#define VPORT_NONE_BORDER	    2
#define VPORT_BORDER_NONE		2
#define VPORT_H_SCROLLBAR		4
#define VPORT_V_SCROLLBAR		8
#define VPORT_VER				8


#define VPORT_BORDER_SIZE		1

/**************************************************************
	DATA STRUCTURE	
**************************************************************/

typedef struct tagViewport
{
	TGuiControl base;
	
	/* extention attribute */

	// 目前viewport中可视范围的左上角   
	int iCurrentLeft ;
	int iCurrentTop ;
	
	// viewport的宽度以及高度  
	int iVirtualHeight;
	int iVirtualWidth ;

	//the size of one page and one dot,when the scrollbar rolling;
	WORD wVScroll_Page;
	WORD wVScroll_Dot;

	WORD wHScroll_Page;
	WORD wHScroll_Dot;
	
	// 置放於viewport中的widget串列   
	struct dLinkList tControlList ;

	//Can't put these scrollbars into controlList;
	HNDL hHScroll,hVScroll;
} TViewport,TGuiViewport;


/**************************************************************
	FUNCTION DECLARATION	
**************************************************************/
/*	create new Viewport */
DLL_EXP(HNDL) guiViewport_Create( WORD wLeft, WORD wTop,WORD wRight,WORD wBottom,WORD nStyle);

/*	delete viewport */
DLL_EXP(STATUS) guiViewport_Delete( HNDL hVport );

/*	enable viewport */
DLL_EXP(STATUS) guiViewport_Show( HNDL hVport );

//get current position
DLL_EXP(STATUS) guiViewport_GetCurrentPos(HNDL hVport,int *pCurrentLeft,int *pCurrentTop);
/*	change view */
DLL_EXP(STATUS) guiViewport_Move(HNDL hVport,int iNewX,int iNewY) ;


/**************************************************************
// 和viewport中widget有关的function 
**************************************************************/

/*
	将某个control加入vport的control list中
*/
DLL_EXP(STATUS) guiViewport_AddControl(HNDL hVport, HNDL hCtrl) ;
DLL_EXP(STATUS) guiViewport_RemoveControl(HNDL hVprot, HNDL hCtrl);
DLL_EXP(STATUS) guiViewport_DeleteAllControl(HNDL hVport);

//refresh viewport's width and height.
DLL_EXP(STATUS)	guiViewport_Refresh_WH(HNDL hVport);
DLL_EXP(STATUS) guiViewport_MoveControlFromPos(HNDL hVport,WORD wBeginPos,short nSize,WORD wType);


/*
	会将可视区内的widget show出来
*/
DLL_EXP(STATUS) guiViewport_Repaint(HNDL hVport) ;

//modify the size of one page and one dot,when the scrollbar rolling;
//wpage 计数以wDot为单位。
DLL_EXP(STATUS) guiViewport_ModiScroll(HNDL hVport,WORD wPage,WORD wDot,WORD wType);



#endif

⌨️ 快捷键说明

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