DX: Full Screen GUI Development 2[14]

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

本文简介:选择自 sonicdater 的 blog

    'need to use transparency if it's a radio button

    if iobjecttype = radiobtn then

        lbltflags = ddblt_wait or ddblt_keysrc

    end if

   

    'don't blit if it a frame control

    if iobjecttype <> framewnd then lret = objsurface.blt(rectbitmap, objbitmap, rectobject, lbltflags)

   

    if bdrawcaption then

        loldcolor = objsurface.getforecolor

        objsurface.setforecolor rgb(255, 255, 255)

        objsurface.drawtext icaptionx, icaptiony, scaption, false

        objsurface.setforecolor loldcolor

    end if

   

    for ilp = 1 to colchildren.count

        colchildren(ilp).drawobject objsurface

    next ilp

 

    exit function

   

drawobjecterr:

    objerr.writeline "error drawing " & sname & " - " & err.description

   

    exit function

end function

 

as you can see the changes are pretty extensive. the function now has to handle the two new controls and the new caption member. the radiobtn is fairly simple since it pretty much acts like the chkbox inside the class. if you looked at the files included with this project you抣l notice that there抯 no bitmap for the frame object. that抯 because it uses directdraw抯 drawline function to draw the outline of the frame. open the framesample.bmp file and zoom in to see how it抯 actually drawn.

 

we抳e added a function in the class to return a child object. this is necessary to change the radiobtn抯 objectstate member when one radio button in a group is clicked:

 

public function getchild(byval skey as string) as clswindow

    set getchild = colchildren(skey)

end function

 

the addchild method was changed to specify a key when adding a child in order to support this function:

 

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

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

go top