added selection cursor
moved working images to working_images folder --HG-- branch : vssg
BIN
framebg.png
Before Width: | Height: | Size: 1,017 B |
BIN
img/selection.png
Normal file
After Width: | Height: | Size: 242 B |
Before Width: | Height: | Size: 262 B After Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 529 B After Width: | Height: | Size: 529 B |
BIN
img/working_images/base_star_lg.psd
Normal file
Before Width: | Height: | Size: 552 B After Width: | Height: | Size: 552 B |
BIN
img/working_images/base_star_lg2.psd
Normal file
Before Width: | Height: | Size: 409 B After Width: | Height: | Size: 409 B |
BIN
img/working_images/base_star_md.psd
Normal file
Before Width: | Height: | Size: 467 B After Width: | Height: | Size: 467 B |
BIN
img/working_images/base_star_md2.psd
Normal file
Before Width: | Height: | Size: 355 B After Width: | Height: | Size: 355 B |
BIN
img/working_images/base_star_sm.psd
Normal file
Before Width: | Height: | Size: 347 B After Width: | Height: | Size: 347 B |
BIN
img/working_images/base_star_sm2.psd
Normal file
72
testui.py
|
@ -1,72 +0,0 @@
|
|||
#import testopt
|
||||
import time
|
||||
import pyui
|
||||
import pyui.themes.win2k
|
||||
|
||||
class MyFrame(object):
|
||||
"""A frame is a window that has a titlebar and borders. it is resizable and movable by dragging the titlebar.
|
||||
"""
|
||||
def __init__(self, x, y, w, h, title, topmost = 0):
|
||||
self.theme = getTheme()
|
||||
self.innerWidth = w
|
||||
self.innerHeight = h
|
||||
self.title = title
|
||||
|
||||
self.panelOffsetLeft = 0
|
||||
self.panelOffsetTop = 0
|
||||
self.panelOffsetRight = 0
|
||||
self.panelOffsetBottom = 0
|
||||
|
||||
Window.__init__(self, x, y, w, h, topmost)
|
||||
self.setTitle(self.title)
|
||||
|
||||
self.panelOffsetLeft = self.theme.getFrameBorderLeft()
|
||||
self.panelOffsetTop = self.theme.getFrameBorderTop()
|
||||
self.panelOffsetRight = self.theme.getFrameBorderRight()
|
||||
self.panelOffsetBottom = self.theme.getFrameBorderBottom()
|
||||
|
||||
self._panel.moveto(self.panelOffsetLeft, self.panelOffsetTop)
|
||||
w += self.panelOffsetLeft + self.panelOffsetRight
|
||||
h += self.panelOffsetTop + self.panelOffsetBottom
|
||||
self.backImage = None
|
||||
|
||||
def setBackImage(self, filename):
|
||||
self.backImage = filename
|
||||
#getRenderer().loadImage(filename)
|
||||
|
||||
|
||||
def draw(self, renderer):
|
||||
"""Draws to the actual frame if the renderer requires it.
|
||||
"""
|
||||
if not self.show:
|
||||
return
|
||||
self.hitList = getTheme().drawFrame( (0,0,self.width, self.height), self.title, self.backImage)
|
||||
Window.draw(self, renderer)
|
||||
|
||||
def onbutton(self):
|
||||
print "got a button "
|
||||
|
||||
def run():
|
||||
#opts = testopt.parseCommandLine(800, 600)
|
||||
done = 1
|
||||
frame = 0
|
||||
t = time.time()
|
||||
desktop = pyui.init(640, 480, '2d')
|
||||
print pyui.core.gRenderer.screen
|
||||
newtheme = pyui.themes.win2k.Win2kTheme(pyui.core.gRenderer, "lucida sans unicode", 14)
|
||||
desktop.setTheme(newtheme)
|
||||
|
||||
w = pyui.widgets.Frame(50, 50, 400, 400, "clipme")
|
||||
b = pyui.widgets.Button( "A button is here", onbutton)
|
||||
w.addChild(b)
|
||||
w.pack()
|
||||
|
||||
w.setBackImage("framebg.png")
|
||||
pyui.run()
|
||||
|
||||
print "done"
|
||||
pyui.quit()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
run()
|
17
testui2.py
|
@ -1,17 +0,0 @@
|
|||
# Hello World example.
|
||||
from ocempgui.widgets import *
|
||||
|
||||
# Initialize the drawing window.
|
||||
re = Renderer ()
|
||||
re.create_screen (640, 480)
|
||||
re.title = "Hello World"
|
||||
re.color = (250, 250, 250)
|
||||
|
||||
button = Button ("Hello World")
|
||||
button.topleft = (10, 10)
|
||||
re.add_widget (button)
|
||||
|
||||
# Start the main rendering loop.
|
||||
re.start()
|
||||
|
||||
re.start()
|