




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
功能描 界面、操 软件设 函数参 函数参 为应用程序开发提供统一控件,主要有Tab 书签 EditBox,类似windowswindows中的帮助。系统about信息的位置。在使用新的GUI后,所有的控件都是基于窗口。这一是由于我们显示开始使用大的#define signed#defineU8 unsignedchar /*unsigned8 bits.*/#defineI16 signedshort /*signed16bits.*/#defineU16 unsignedshort /*unsigned16bits.*/#defineI32 signedlong /*signed32bits.*/#defineU32 unsignedlong /*unsigned32bits.*/#defineLPTRunsigned /*0page我们所建立的窗口跟Windows类似,只是我们的要简单一些。系统开始,要DesktopWindow,主要用来画背景色,其他窗口都是它的子等。具体界面信息有窗口名称、其左上角相对于父窗口的坐标、窗口宽高、窗口字模、背景颜色、前景颜色、激活键、窗口的状态等;系统信息有消息的传递、窗口层次Zorder、//#defineHWIN#defineLPWININFO//#define 1/*Repaintwindow(becausecontentis(partially)invalid#define 2/*Windowhasbeenpartiallycovered.Normally,thereisnoreactiontothis#define 3/*Thefirstmessagereceived,right hasactuallybeencreated#defineWM_DELETE 4/*Delete(Destroy)command:This lsthe itsdatastruturessincethewindowitisassociateswithnolongerexists.*/#defineWM_SIZE 6/*Issenttoawindowafteritssizehaschanged*/#defineWM_MOVE 7/*windowhasbeenmoved*/#defineWM_SHOW 8/*windowshasjustreceivedtheshowcommand*/#defineWM_HIDE 9/*windowshasjustreceivedthehidecommand*/#defineWM_FGND 10/*windowhasbeenmadetopofwindowstack*/#defineWM_BGND 11/*windowhasjustbeenputtobottomofstack*/#defineWM_TOUCH 12/*touchscreenmessage*/#define 13/*Keyhasbeenpressed#defineWM_GET 100/*getrectangleinwindowcoordinates*/#define RECT_ABS101/*getrectangleinabsolute#defineWM_GET_INSIDE_RECT 102/*getinsiderectangle:rectangleminuspixelslosttoeffect*/#defineWM_GETORG #define /*Getidofwidget#defineWM_GET__WINDOW 106/*Getwindowhandleofwindow.Defaultisthesameaswindow*/#defineWM_CAPTURE_RELEASED /*Letwindowknowthatmousecaptureisover#define /*Informdialogthatitisreadyforinit#defineWM_SET_FOCUS /*Informwindowthatithasgottenorlostthefocus*/#defineWM_GET_ACCEPT_FOCUS111 /*Findoutifwindowcanacceptthefocus*/#defineWM_GET_FOCUSSED_CHILD112 /*Whichchildcurrentlyhasthefocus*/#define /*Doesthiswindowhavethefocus?#define /*Returnbackgroundcolor(onlyframewindowand#defineWM_SET_ENABLE /*Enableordisablewidget*/#defineWM_GET_SCROLL_STATE116 /*Querystateofscrollbar*/#define /*Scrolleradded#define /*Setscroll onlyeffectiveforscrollbars#define #define forusermessages/*窗口创建标志。WindowscreateflagsTheseflagscanbepassedtothecreatewindowfunctionasflag-parameter.Theflagsarecombinableusingthebinaryor#define/*Hastransparency.Needstobeforwindowswhichdonotfillthesectionoftheir )rectangle.#define/*Hidewindowaftercreation(default!)#define/*Showwindowaftercreation#define/*Putwindowinforegroundafter(default!)#define/*Putwindowinbackgroundaftercreation#define/*Usememorydeviceforredraws#defineWM_CF_STAYONTOP(1<<4)/*Stayontop#define (1<<5)/*Ifautomaticactivationuponcreationwindowisdesired/*窗口状态,只是#define #define #defineWM_SF_INUSE /*markentryinarrayasused*/#defineWM_SF_MEMDEV #define /*Isvisibleflag//typedeftagWININFOintLeft //intWidth,Height; //窗口的宽高LPTRWM_NAME;//窗口名称intFont; //字模int //int //int //LPTRWM_CALLBACK;//}typedeftagWINintStyle, //HWINhNextLin; //NextwindowinlinearlistHWINhParent,hFirstChild,hNext; //父子窗口链表LPWININFOlpWinInfo; //窗口信息}//typedefstructint /*typeofmessageHWINhWin; /*Destinationwindow*/HWINhWinSrc; /*Sourcewindow*/union{void*p; /*Somemessagesneedmoreinfo...*/intv;GUI_COLOR}}//HWINCreateWindowLPWININFOlpWinInfoHWINhWinParentU16StyleintNumExtraBytesFunction:根据窗口信息结构创建一个窗口。InputlpWinInfohWinParentStyleNumExtraBytes当创建控件时,需额外分配的RAM大小。本来可以在结构起始定义每个结构的大小,但这样会增加RAM的使用,所以用传参的方式。Return:voidWinDeleteWindow(HWINhWinFunction:InputhWinReturn://intWinIsWindow(HWINhWinFunction:InputhWinReturn:0//voidHideWindowHWINhWinFunction:隐藏窗口InputhWinReturn:voidShowWindowHWINhWinFunction:显示窗口InputhWinReturn://Set/clearthehastransparencyflagvoidWinSetHasTrans(HWINhWin);voidWinClrHasTrans(HWINhWin);intWinGetHasTrans(HWINhWin);//Invalidate/validatewindowsorrectanglesvoidWinInvalidateArea(GUI_RECT*pRect);voidWinInvalidateRect(HWINhWin,constGUI_RECT*pRect);voidInvalidateWindow(HWINhWinFunction:InputhWinReturn:voidWinValidateRect(HWINhWin,constGUI_RECT*pRect);voidValidateWindowHWINhWinFunction:置窗口有效标志InputhWinReturn://voidWM_MoveWindow(HWINhWin,intdx,intdy);voidWM_ResizeWindow(HWINhWin,intXSize,intYSize);voidWM_MoveTo(HWINhWin,intx,inty);voidWM_SetSize(HWINhWin,intXSize,intYSize);//WINCALLBACKWinSetCallbackHWINhWinWINCALLBACKcbFunction:设置窗口回调函数InputhWinReturn:00//voidvoidRect(GUI_RECT*pRectFunction:获得当前活动窗口客户区矩形(是客户区坐标)。ReturntherectangleinThismeansforallwindowsthatx0y00x1width1,y1height1Input:pRect窗口矩形Return:voidWinGetInsideRect(HWINhWin,GUI_RECT*pRect);Function:Returntheinsiderectangleincoordinates.Theinsiderectangleistherectangleminusthewhichtypicallyreducestherectangleby0-3pixelsoneitherside(2forthestandard3Deffect).InputhWinpRect返回除去边界效果的客户区矩形Return:无voidWinGetWindowRectGUI_RECT*pRectFunction:获得窗口的屏幕坐标InputpRectReturn:intFunction:获得当前活动窗口原点的屏幕xInput:Return:获得当前活动窗口原点的屏幕xFunction:获得当前活动窗口原点的屏幕yInput:Return:获得当前活动窗口原点的屏幕yintWinGetOrgX(HWINFunction:获得某一窗口原点的屏幕xInput:Return:窗口原点的屏幕xFunction:获得某一窗口原点的屏幕yInput:Return:窗口原点的屏幕y坐标intWinGetWidth(HWINhWin);Function:获得某一窗口的宽度Input:无Return:intWinGetHeight(HWINFunction:Input:Return:HWINWinGetFirstChild(HWINhWin);Function:获得某窗口第一个子窗口的句柄Input:hWin窗口句柄Return:HWINWinGetNextSibling(HWINhWin);Function:获得某一窗口的下一个兄弟窗口Input:hWin窗口句柄Return:HWINWinGetParent(HWINhWin);Function:获得某一窗口的父窗口句柄Input:hWin窗口句柄Return:intWinGetId(HWINhWin);HWINHWINWindow(HWINhWinInputhWinReturn:GUI_COLORWinGetBkColorHWINhWinFunction:获得窗口的背景色InputhWinReturn://改变窗口的Z-Function:将窗口放在Z-Order的最底Input:hWin窗口句柄Return:voidWM_BringToTop(HWINhWin);Function:将窗口放在Z-Order的最顶Input:hWin窗口句柄Return:GUI_COLORWinSetDesktopColor(GUI_COLORColor);Function:设定Desktop窗口颜色InputColorReturn:原Desktop/*Selectwindowusedfordrawingoperations*/HWINWinSelectWindow(HWINhWin);Function:使某一窗口成为活动窗口InputhWinReturn:HWINWM_GetActiveWindow(void);Function:获得当前活动窗口句柄Input:无Return:voidWinPaint(HWINhWin);Function:刷新某一窗口InputhWinReturn:/*Getforeground/backgroundwindows*/HWINWinGetDesktopWindow(void);Function:获得背景窗口(Desktop)句柄Input:hWin无Return:/*ReduceclipareaofawindowconstGUI_RECT*WinSetUserClipRect(constGUI_RECT*pRect);Function:设定用户更新区域InputpRectReturn:voidFunction:GUIInput:Return:/*UseofmemorydevicesvoidWM_EnableMemdev(HWINhWin);voidWM_DisableMemdev(HWINhWin);intWinOnKey(intKey,intPressed);Function:发送键盘信息到焦点窗口Input:Key用户按下的键值PressedReturn:0没有处理按键消息;1//voidWinNotifyParent(HWINhWinintNotification);Function:将消息通知父窗口去处理InputhWinNotificationReturn:voidWinSendMessage(HWINhWin,WINMESSAGE*p);Function:将消息发送到某一窗口去处理InputhWinpWindowsReturn:voidWinDefaultProc(WINMESSAGE*pMsg);Function:窗口的默认处理程序InputpMsgReturn:voidWinBroadcastMessageWINMESSAGE*pMsg);Function:向所有的窗口发送消息InputpMsgReturn:voidWinSetScrollState(HWINhWinconstWINSCROLL_STATE*pState);Function:设定滚动条的状态InputpStateReturn:voidWinSetEnableState(HWINhItemintState);Function:使窗口(控件)活动或无效InputhWin窗口(控件)State0:窗口(控件)无效;1:窗口(控件)活动Return:无voidWinSendToParent(HWINhWinWINMESSAGE*pMsg);Function:向父窗口发送消息InputhWinpMsgReturn:intWinHasCaptured(HWINhWin);Function:Setsthefocustothespecifiedchild.Itsends2messages:WM_SET_FOCUS(1)towindowtoreceivefocusWM_SET_FOCUS(0)towindowtolosefocusInputhWinReturn: onsuccess(Focuscouldbe!=0onfailure(Windowscouldnottakethefocus)HWINWinGetFocussedChild(HWINhWin);Function:获得焦点子窗口(控件)InputhWinReturn:子窗口(控件)HWINWinSetFocusOnNextChild(HWINhParent);Function:SetthefocustothenextchildInputhParentReturn:HWINWinGetDialogItem(HWINhWin,intId);Function:跟据控件的Id或得其窗口句柄Input:hWin父窗口句柄Id控件Return:voidWinEnableWindowHWINhWin);Function:使某一窗口成为活动窗口Input:hWin窗口句柄Return:Function:使某一窗口失效InputhWinReturn:Function:获得滚动条的状态InputpScrollStateReturn:intFunction:PollsthetouchscreenIfsomethinghaschangedsendsamessagetotheconcernedwindow.Input:无Return:0ifnothinghasbeendone;1iftouchmessagehasbeensentHWINWinScreen2hWin(intx,inty);Function:InputxyReturn://intWinInitIVRSearch(constGUI_RECT*pMaxRect);intWinGetNextIVR(void);触,可以考虑弹出时间设置界面。TimeBar会处理分钟消息。看看系统是否一个时间消息窗口句柄数 TIMEBAR_DISP_TYPE24typedeftagTIMEBARWIN TimeBarint}HWINCreateTimeBarLPWININFOlpWinInfoHWINhWinParentU16StyleFunction:创建时间状态条InputlpWinInfohWinParentflagb01:b11:b21:24小时制显示0:12 Return:如果创建成功,返回TimeBarvoidTimeBarDelete(HWINhTimeBarFunction:删除TimeBarInput: 创建TimeBartypedeftagSYSINFBARWINwSysInfBar;SysInfBarint}HWINSysInfBarCreate(LPWININFOlpWinInfoHWINhParentintStyleFunction:建立并显示SysInfBarInputlpWinInfo 创建SysInfBar Return:voidSysInfBarDeleteHWINhSysInfBarFunction:删除SysInfBarInput: 创建SysInfBar显示带文本的button,暂不支持图形typedeftagBUTTONWINwButton;//Button}HWINButtonCreate(LPWININFOlpWinInfo,HWINhParentintStyleFunction:在某一窗口创建并显示一buttonInput voidButtonDeleteHWINhButtonFunction:删除ButtonInput: 创建ButtonvoidButtonSetState(HWINhButtonintStateFunction:设置button的状态Input: buttonState1:enable0://如果lpWinInfo是放在RAMvoidButtonSetTextHWINhButton,LPSTRsButtonFuncton:button的文本Input: button buttonvoidButtonSetFontHWINhButtonGUI_FONTFontTypeFunction:设置button显示文本的字体Input: button voidButtonSetBkColorHWINhButton,GUI_COLORcolorFunction:设置button的背景色Input: button voidButtonSetTextColorHWINhButtonGUI_COLORcolorFunction:设置button的文本色Input: button 3.5.1#defineL#defineL#defineL#defineL#defineL#defineL#defineL#defineL#defineL#defineL#defineL#defineMB_ICONINFORMATION #defineMB_ICONSTOP #defineL#defineL#defineL//return#define1#define2#define3#define4#define5#define6#define7typedeftagMESSAGEBOXWINwMessageBox;//MessageBoxHWINHWINLPTR}typedeftagMESSAGEBOXINFO{LPTRicon; //提示图标地址LPTRmessage;//}intMessageBox(LPWININFOlpWinInfo,LPMESSAGEBOXINFOlpMessageBoxInfo,HWINhParent,intStyle);Function:创建并显示InputlpWinInfolpMessageBoxInfoMessageBox //包含哪些 Themessageboxcontainsthreepushbuttons:Abort,Retry,and Themessageboxcontainsonepushbutton:OK.Thisisthedefault. Themessageboxcontainstwopushbuttons:OKandCancel. Themessageboxcontainstwopushbuttons:RetryandCancel. Themessageboxcontainstwopushbuttons:YesandNo. Themessageboxcontainsthreepushbuttons:Yes,No,and//使用什么样的 Aquestion-markiconappearsinthemessage Anexclamation-pointiconappearsinthemessage Aniconconsistingofalowercaseletteriinacircleappearsinthe messagebox. Astop-signiconappearsinthemessagebox.//缺省 Thefirstbuttonisthedefaultbutton. Thesecondbuttonisthedefaultbutton. Thethirdbuttonisthedefaultbutton. AbortbuttonwasIDCANCELCancelbuttonwasselected.IDIGNOREIgnorebuttonwasselected. Nobuttonwasselected. OKbuttonwasselected. Retrybuttonwasselected. Yesbuttonwasselected.typedeftagSCROLLBAR{WINwScroll;LPTR}typedeftagSCROLLBARINFO{unsignedlongnMin;//最小值unsignedlongnMax;//最大值unsignedlongnPos; //当前位置intnPage; //翻页值}HWINScrollBarCreate(LPWININFOlpWinInfo,LPSCROLLBARINFOlpScrollBarInfo,HWINhParent,intStyle);Function:建立并显示Input:lpWinInfo窗口信息结构lpScrollBarInfo滚动条信息结构 Style创建ScrollBar标志 保Return:voidScrollBarDelete(HWINhWin);Function:删除ScrollBarInput:hWin ScrollBar句柄Return:voidScrollBarAddValue(HWINhWin,intAdd);Function:将ScrollBar当前位置值加上更改量Input:hWin ScrollBar句柄 Return:voidScrollBarDec(HWINhWin);Function:ScrollBar减一Input:hWin ScrollBar句柄Return:voidScrollBarInc(HWINhWin);Function:hWinScrollBar加一Input:hWinScrollBar句柄Return:无voidScrollBarSetNumItems(HWINhWin,intNumItems voidScrollBarSetPageSizeHWINhWinintPageSize);Function:设置ScrollBar滚动一页的大小Input:hWin滚动条句柄PageSizeReturn:voidScrollBarSetValueHWINhWinintv);Function:设置滚动条当前的位置Input:hWin滚动条句柄vReturn:intScrollBarGetValue(HWINhWin);Function:获得滚动条当前的位置Input:hWin滚动条句柄Return:滚动条当前位置的值 LPSLIDERINFOtypedeftagSLIDERBAR{WINwSliderBar;LPTR}typedeftagSLIDERBARINFOint //int //int //intNumSections;//}HWINSliderBarCreate(LPWININFOlpWinInfo,LPSLIDERINFOlpSliderInfo,HWINhParent,intStyle);Function:创建并显示SliderBarInputlpWinInfo窗口信息结构lpSliderInfohParentStyle创建SliderBarReturnSlierBarvoidSliderBarDeleteHWINhWinFunction:删除SliderBarInput:hWinSliderBar句柄Return:无voidSliderBarInc(HWINhWin);Function:hWinSliderBar加一Input:hWinSliderBar句柄Return:无voidSliderBarDec(HWINhWin);Function:SliderBar减一InputhWinSliderBar句柄Return:无voidSliderBarSetValueHWINhWinintvFunction:设置滑块当前的位置Input:hWin滑块句柄vReturn:intSliderBarGetValue(HWINhWinFunction:获得滑块当前的位置Input:hWin滑块句柄Return:滑块当前位置的值voidSliderSetWidth(SliderHandlehObj,intvoidSliderBarSetRange(HWINhWin,intMin,intMax typedeftagPROGRESSBAR{WINwProgressBar;LPTR}typedeftagPROGRESSBARINFOlongnMin;//最小值longnMax;//longnVal;//}HWINProgressBarCreate(LPWININFOlpWinInfo,LPPROGRESSBARINFOlpProgressBarInfo,HWINhParent,intStyle);Function:Input:lpWinInfo窗口信息结构lpProgressBarInfo进度条信息结构hParent父窗口句柄StyleReturn:voidProgressBarDelete(HWINhWinFunction:删除ProgressBarInput:hWinProgressBar句柄Return:无voidProgressBarSetValue(HWINhWinintv);Function:设置进度条进度值InputhObjvReturn:intProgressBarGetValueHWINhWinFunction:获得进度条当前进度值Input:hWin进度条句柄Return:进度条当前进度的值voidProgressBarSetBarColor(HWINhObj,intindex,GUI_COLORcolor);voidProgressBarSetFont(HWINhObj,constGUI_FONT*pfont);voidProgressBarSetMinMax(HWINhObj,intMin,intMax);voidProgressBarSetText(HWINhObj,constchar*s);voidProgressBarSetTextColor(HWINhObj,intindex,GUI_COLORcolor);voidProgressBarSetTextPos(HWINhObj,intXOff,intYOff); //Tab窗int // //Tab信typedeftagTABINFOint //int //排列方向,有无边界,有无阴intFocusBkColor; //菜单选中时背景色intFocusFgColor; //菜单选中时前景色intInvalidFgColor; //菜单无效时前景色LPTRStrTab; //菜单文本数组LPTRFuncTab;//菜单函数数组LPTRActiveKeyTab;//激活键表 WININFO HWINHWINCreate(LPWININFOlpWinInfo,INFOInfo,HWINhParent,StyleFunction:创建并显示Input:lpWinInfo窗口信息结构lpTabInfo菜单信息结构hParent父窗口句柄StyleReturn:菜单句voidvoidDelete(HWINhWinFunction:删除Input:hWinTab句Return:Letter是广泛意义上的。将PopRadioCheckBoxSelectIcon全部合到此种中。typedeftagLETTERWINwLetter //Letter窗HWIN //int //LPTRlpState; //指向菜单项状态数组,如果为0,默认是普通菜单,所有菜单项LPTRLETTERINFO;//Letter信}LETTERint //菜单项状态数组,可令lpState指向该数组
typedeftagLETTERINFOint //int //排列方向,有无边界,有无滚动条,有无阴影,是否Pop,是intFocusBkColor;//菜单选中时背景色intFocusFgColor;//菜单选中时前景色intInvalidFgColor;//菜单无效时前景色intxItem,yItem;//横向和纵向的item数intdx, //各个itemLPTRITEMINFO[];//菜单项属性数}LETTERtypedefstructtagITEMINFO{//菜单项结int //MFT_RADIOCHECK//直接用bmpChecked和bmpUnchecked指向相应的RadioBMP icon iconint //菜单项ID,当用户选中此菜单时,会发送此IDint //LPTRlpSub //子菜单地BITMAPbmpChecked; //用户自定义选中时的bitmapBITMAP //用户自定义未选中的BITMAP //用户可在菜单前放一iconLPTR //LPTR //如果不为NULL}HWINHWINCreate(LPWININFOlpWinInfo,INFOInfo,HWINintStyleFunction:创建并显示LetterInputlpWinInfo窗口信息结构lpLetterInfo菜单信息结hParentStyleReturn:菜单句voidvoidDelete(HWINhWinFunction:删除LetterInput:hWinLetter句柄Return:无U16U16CheckItem(HWIN,U16wID,U16uCheckFunction:Input:h菜单句wID菜单项uCheck Setsthecheck-markattributetothecheckedMF_UNCHECKEDSetsthecheck-markattributetotheuncheckedReturn:thepreviousstateofthevoidvoidCheckRadioItem(HWIN,U16idFirst,U16idLast,U16idCheckFunction:TheLetterCheckRadioItemfunctionchecksaspecifieditemandmakesitaradioitem.Atthesametime,thefunctionunchecksallotheritemsintheassociatedgroupandclearstheradio-itemtypeflagforthoseitems.Input:hHandletothethatcontainsthegroupofitems.idFirstIdentifierorpositionofthefirstiteminthegroup.idLastIdentifierorpositionofthelastitem
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 人防工程制式销售合同范本
- 分散采购服务合同范本
- 农村燃气安装合同范例
- 协助宠物国际托运合同范本
- 农田租赁合同范本
- 专利转让入股合同范本
- 养鱼合作转让合同范本
- 公版采购合同范本
- 单位解聘教师合同范本
- 买卖中介公司合同范本
- 人教版小学数学一年级下册教案
- 《住院患者身体约束的护理》团体标准解读课件
- 新版人音版小学音乐一年级下册全册教案
- 2024年黑龙江建筑职业技术学院单招职业适应性测试题库全面
- MOOC 跨文化交际通识通论-扬州大学 中国大学慕课答案
- CBT主要技术精品课件
- 常用液压元件型号对照表230
- 项目章程模板范文
- 泰山产业领军人才工程系统
- 轮扣架支模体系材料量计算
- 主题班会教案《读书好读好书好读书》班会方案
评论
0/150
提交评论