foursplit.py :  » GUI » FXPy » FXPy-1.0.5 » examples » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » GUI » FXPy 
FXPy » FXPy 1.0.5 » examples » foursplit.py
#! /usr/bin/env python

from FXPy.fox import *

class FourSplitWindow(FXMainWindow):
    def __init__(self, app):
        # Base class constructor
        FXMainWindow.__init__(self, app, "4-Way Splitter Test",
            w=800, h=600, hs=0, vs=0)

        # Menu bar
        menubar = FXMenubar(self, LAYOUT_SIDE_TOP|LAYOUT_FILL_X);

        # Status bar
        FXStatusbar(self,
            LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X|STATUSBAR_WITH_DRAGCORNER);

        # Create the split
        splitter = FX4Splitter(self,
            LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y|FOURSPLITTER_TRACKING);

        # File menu
        filemenu = FXMenuPane(self)
        FXMenuCommand(filemenu, "&Quit\t\tQuit the application.",
            None, self.getApp(), FXApp.ID_QUIT)
        FXMenuTitle(menubar, "&File", None, filemenu)

        # Expand menu
        expandmenu = FXMenuPane(self)
        FXMenuCommand(expandmenu, 'All four', None,
            splitter, FX4Splitter.ID_EXPAND_ALL)
        FXMenuCommand(expandmenu, 'Top/left', None,
            splitter, FX4Splitter.ID_EXPAND_TOPLEFT)
        FXMenuCommand(expandmenu, 'Top/right', None,
            splitter, FX4Splitter.ID_EXPAND_TOPRIGHT)
        FXMenuCommand(expandmenu, 'Bottom/left', None,
            splitter, FX4Splitter.ID_EXPAND_BOTTOMLEFT)
        FXMenuCommand(expandmenu, 'Bottom/right', None,
            splitter, FX4Splitter.ID_EXPAND_BOTTOMRIGHT)
        FXMenuTitle(menubar, '&Expand', None, expandmenu)

        # Four widgets in the four splitter
        FXButton(splitter, "Top &Left\tThis splitter tracks",
            opts=FRAME_RAISED|FRAME_THICK)
        FXButton(splitter, "Top &Right\tThis splitter tracks",
            opts=FRAME_RAISED|FRAME_THICK)
        FXButton(splitter, "&Bottom Left\tThis splitter tracks",
            opts=FRAME_SUNKEN|FRAME_THICK)
        subsplitter = FX4Splitter(splitter, LAYOUT_FILL_X|LAYOUT_FILL_Y)
        temp = FXButton(subsplitter,"&Of course\tThis splitter does NOT track",
            opts=FRAME_SUNKEN|FRAME_THICK)
        temp.setBackColor(FXRGB(0,128,0))
        temp.setTextColor(FXRGB(255,255,255))
        temp = FXButton(subsplitter,"the&y CAN\tThis splitter does NOT track",
            opts=FRAME_SUNKEN|FRAME_THICK)
        temp.setBackColor(FXRGB(128,0,0))
        temp.setTextColor(FXRGB(255,255,255))

        temp = FXButton(subsplitter,"be &NESTED\tThis splitter does NOT track",
            opts=FRAME_SUNKEN|FRAME_THICK)
        temp.setBackColor(FXRGB(0,0,200));
        temp.setTextColor(FXRGB(255,255,255));
        temp = FXButton(subsplitter,
            "&arbitrarily!\tThis splitter does NOT track",
            opts=FRAME_SUNKEN|FRAME_THICK)
        temp.setBackColor(FXRGB(128,128,0))
        temp.setTextColor(FXRGB(255,255,255))

        tooltip = FXTooltip(self.getApp())

    # Create and show the main window
    def create(self):
        FXMainWindow.create(self)
        self.show(PLACEMENT_SCREEN)

def runme():
    import sys
    application = FXApp("FourSplit", "FoxTest")
    application.init(sys.argv)
    FourSplitWindow(application)
    application.create()
    application.run()

# Main program starts here
if __name__ == "__main__":
    runme()
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.