Added framerate selection
This commit is contained in:
parent
6fea123682
commit
3885701e5f
|
|
@ -143,7 +143,7 @@ def onKeyDownObj(self, key):
|
|||
add_keyframe()
|
||||
|
||||
def create_sc(root):
|
||||
retval = ".flash bbox=500x500 background=#ffffff\n"+root.print_sc()+".end"
|
||||
retval = ".flash bbox=500x500 background=#ffffff fps="+str(svlgui.FRAMERATE)+"\n"+root.print_sc()+".end"
|
||||
return retval
|
||||
def run_file(self=None):
|
||||
global root
|
||||
|
|
|
|||
|
|
@ -237,6 +237,21 @@ class MainWindowOSX:
|
|||
i.setvisible(True)
|
||||
else:
|
||||
i.setvisible(False)
|
||||
|
||||
self.docbox = svlgui.Frame()
|
||||
self.sizelabel = svlgui.Label("Size: ")
|
||||
self.sizebutton = svlgui.Button(" 500 x 500 pixels ")
|
||||
self.publishlabel = svlgui.Label("Publish: ")
|
||||
self.publishbutton = svlgui.Button(" Settings... ")
|
||||
self.frameratelabel = svlgui.Label("Framerate: ")
|
||||
self.frameratentry = svlgui.TextEntry("50")
|
||||
self.frameratentry.set_action(self.set_framerate)
|
||||
self.docbox.layout_self( [self.sizelabel,0,None,0,None,"nw", ""],
|
||||
[self.sizebutton,self.sizelabel._int(),None,0,None,"nw", ""],
|
||||
[self.publishlabel,0,None,self.sizebutton._int(),None,"nw", ""],
|
||||
[self.publishbutton,self.publishlabel._int(),None,self.sizebutton._int(),None,"nw", ""],
|
||||
[self.frameratelabel,0,None,self.publishbutton._int(),None,"nw", ""],
|
||||
[self.frameratentry,self.frameratelabel._int(),None,self.publishbutton._int(),None,"nw", ""])
|
||||
self.frame.layout_self( [self.toolbox,0,None,0,None,"nw",""],
|
||||
#[self.paintbox,0,245,0,0,"nws","v"],
|
||||
[self.timelinebox,self.toolbox._int()+148,-500,0,None,"new","hv"],
|
||||
|
|
@ -244,10 +259,14 @@ class MainWindowOSX:
|
|||
[self.layerbox,self.toolbox._int(),self.toolbox._int().width+150,0,None,"n","v"],
|
||||
#[self.layerbox,self.paintbox._int(),self.toolbox._int().width+150,0,None,"n","v"],
|
||||
[self.scriptwindow,self.timelinebox._int(),0,0,0,"nse", "hv"],
|
||||
[self.stage,self.toolbox._int(),self.scriptwindow._int(),self.timelinebox._int()+2,0,"nsew", "hv"],
|
||||
[self.docbox,self.toolbox._int(),self.scriptwindow._int(),None,0,"wse", ""],
|
||||
[self.stage,self.toolbox._int(),self.scriptwindow._int(),self.timelinebox._int()+2,self.docbox._int(),"nsew", "hv"],
|
||||
[self.paintbox,0,self.stage._int(),self.toolbox._int(),None,"nw","v"] )
|
||||
#[self.stage,self.paintbox._int(),self.scriptwindow._int(),self.timelinebox._int()+2,0,"nsew", "hv"] )
|
||||
self.window.add(self.frame)
|
||||
|
||||
def set_framerate(self):
|
||||
svlgui.FRAMERATE=int(self.frameratentry.text)
|
||||
|
||||
# use mainwindowosx, this is just to comment things out
|
||||
class MainWindowHTML:
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ def paint_bucket(self):
|
|||
svlgui.set_cursor("bucket", stage)
|
||||
update_tooloptions()
|
||||
|
||||
|
||||
def update_tooloptions():
|
||||
for i in svlgui.TOOLOPTIONS:
|
||||
if svlgui.MODE==svlgui.TOOLOPTIONS[i]:
|
||||
|
|
|
|||
24
svlgui.py
24
svlgui.py
|
|
@ -34,6 +34,8 @@ SITER=0
|
|||
#Currentframe - the frame selected on the timeline. Not necessarily the frame being shown.
|
||||
CURRENTFRAME=0
|
||||
|
||||
FRAMERATE=50
|
||||
|
||||
#Object which has the keyboard focus.
|
||||
FOCUS = None
|
||||
|
||||
|
|
@ -147,7 +149,7 @@ if sys.platform=="linux2":
|
|||
from GUI import Frame as OSXFrame, Color as OSXColor, Grid as OSXGrid
|
||||
from GUI import Label as OSXLabel, RadioGroup as OSXRadioGroup, RadioButton as OSXRadioButton
|
||||
from GUI import Column, Row, ScrollableView, TextEditor, Colors, ModalDialog
|
||||
from GUI import StdCursors, Alerts, FileDialogs, Font
|
||||
from GUI import StdCursors, Alerts, FileDialogs, Font, TextField
|
||||
from GUI.StdMenus import basic_menus, file_cmds, print_cmds
|
||||
from GUI.Files import FileType
|
||||
from GUI.Geometry import offset_rect, rect_sized
|
||||
|
|
@ -168,7 +170,7 @@ elif sys.platform=="win32":
|
|||
from GUI import Frame as OSXFrame, Color as OSXColor, Grid as OSXGrid
|
||||
from GUI import Label as OSXLabel, RadioGroup as OSXRadioGroup, RadioButton as OSXRadioButton
|
||||
from GUI import Column, Row, ScrollableView, TextEditor, Colors, ModalDialog
|
||||
from GUI import StdCursors, Alerts, FileDialogs, Font
|
||||
from GUI import StdCursors, Alerts, FileDialogs, Font, TextField
|
||||
from GUI.StdMenus import basic_menus, file_cmds, print_cmds
|
||||
from GUI.Files import FileType
|
||||
from GUI.Geometry import offset_rect, rect_sized
|
||||
|
|
@ -190,7 +192,7 @@ elif sys.platform=="darwin":
|
|||
from GUI import Frame as OSXFrame, Color as OSXColor, Grid as OSXGrid
|
||||
from GUI import Label as OSXLabel, RadioGroup as OSXRadioGroup, RadioButton as OSXRadioButton
|
||||
from GUI import Column, Row, ScrollableView, TextEditor, Colors, ModalDialog
|
||||
from GUI import StdCursors, Alerts, FileDialogs, Font
|
||||
from GUI import StdCursors, Alerts, FileDialogs, Font, TextField
|
||||
from GUI.StdMenus import basic_menus, file_cmds, print_cmds
|
||||
from GUI.Files import FileType
|
||||
from GUI.Geometry import offset_rect, rect_sized
|
||||
|
|
@ -839,6 +841,22 @@ class TextView(Widget):
|
|||
if SYSTEM=="osx":
|
||||
self.scroll_page_down();
|
||||
|
||||
class TextEntry(Widget):
|
||||
def __init__(self,text="",password=False):
|
||||
if SYSTEM=="osx":
|
||||
self.entry = TextField(text=text,multiline=False,password=password)
|
||||
def _int(self):
|
||||
if SYSTEM=="osx":
|
||||
return self.entry
|
||||
def set_action(self,action):
|
||||
if SYSTEM=="osx":
|
||||
self.entry.enter_action = action
|
||||
def get_text(self):
|
||||
return self.entry.text
|
||||
def set_text(self, text):
|
||||
self.entry.text = text
|
||||
text = property(get_text, set_text)
|
||||
|
||||
class Image(object):
|
||||
def __init__(self,image,x=0,y=0,animated=False,canvas=None,htiles=1,vtiles=1,skipl=False):
|
||||
if not skipl:
|
||||
|
|
|
|||
Loading…
Reference in New Issue