DX: Full Screen GUI Development 2[1]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 sonicdater 的 blog

full screen gui development

pt 2 ?more controls & text

by jim (machaira) perry

 

 

welcome back! if you抮e saying 揾uh?!?then you probably haven抰 read the first part of this tutorial. please read it before continuing because we抣l be building on it.

 

download this tutorial (in word format) and the sample projects in a zip file (40 kb)

 

first up

 

let抯 build on our base window by adding the standard minimize, maximize/restore, and close buttons (see windowsample3 project).

 

we抳e added enums for the new buttons:

 

    closebtn

    minbtn

    maxbtn

    restorebtn

 

created bitmaps for them (close.bmp, minimize.bmp, maximize.bmp, and restore.bmp), and added instances of the clswindow class in the moddirectdraw module to create them:

 

public withevents closebutton as new clswindow

public withevents minbutton as new clswindow

public withevents maxbutton as new clswindow

public withevents restorebutton as new clswindow

 

notice that we抳e added withevents to the declarations. this will allow us to do things outside of the class when the control is clicked. we抣l go over this a little later.

 

new controls mean that we have to add them as child controls to the base window object. we抳e done this in the createwindowobjects function, setting the necessary properties for them:

 

    with frmmain.closebutton

        .objecttype = closebtn

        .parentheight = frmmain.window.height

        .parentwidth = frmmain.window.width

        .parentx = frmmain.window.x

        .parenty = frmmain.window.y

        .objectsurface = objdd.createsurfacefromfile(app.path & "\close.bmp", ddsdsurf4)

        .windowname = "closebtn"

    end with

    frmmain.window.addchild frmmain.closebutton

   

    with frmmain.minimizebutton

        .objecttype = minbtn

本文关键:DX: Full Screen GUI Development
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top