DlgClassDiagramProperties.py :  » UML » Python-UML-Tool » pyut-1.4.0 » src » 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 » UML » Python UML Tool 
Python UML Tool » pyut 1.4.0 » src » DlgClassDiagramProperties.py
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
__version__ = "$Revision: 1.6 $"
__author__ = "EI5, eivd, Group Burgbacher - Waelti"
__date__ = "2002-02-23"

from __future__ import nested_scopes
#from wxPython.wx import *
from pyutUtils import *
#from PyutPrefs   import *
from PyutPreferences import *
from OglClass import *
import lang, wx

class DlgClassDiagramProperties(wx.Dialog):
    """
    This is the class diagram properties dialog box

    Display current properties and possible values, save modified values.

    To use it from a wx.Frame :
        dlg = DlgProperties(self, -1, PyutPreferences(), Mediator())
        dlg.ShowModal()
        dlg.Destroy()
    
    :version: $Revision: 1.6 $
    :author: C.Dutoit
    :contact: dutoitc@hotmail.com
    """
    def __init__(self, parent, ID, ctrl):
        """
        Constructor.

        @param wx.Window parent Parent
        @param int ID ID
        @param Mediator ctrl
        @author Laurent Burgbacher <lb@alawa.ch>
        @since 1.0
        """
        wx.Dialog.__init__(self, parent, ID, _("File properties"))
        self.__ctrl = ctrl
        self.__initCtrl()

        self.Bind(EVT_CLOSE, self.__OnClose)

    #>------------------------------------------------------------------------

    def __initCtrl(self):
        """
        Initialize the controls.

        @since 1.0
        """
        # IDs
        [
            self.__showParamsID, self.__showStereotypeID, self.__showFieldsID,
            self.__showMethodsID] = assignID(4)

        GAP = 5

        sizer = wx.BoxSizer(wx.VERTICAL)

        # Show Params
        self.__cbShowParams = wx.CheckBox(self, self.__showParamsID,
            _("&Show params in classes"))
        self.__cbShowStereotype = wx.CheckBox(self, self.__showStereotypeID,
            _("&Show stereotype in classes"))
        self.__cbShowFields = wx.CheckBox(self, self.__showFieldsID,
            _("&Show fields in classes"))
        self.__cbShowMethods = wx.CheckBox(self, self.__showMethodsID,
            _("&Show methods in classes"))

        # Add params to sizer
        sizer.Add(self.__cbShowParams,     0, wx.ALL, GAP)
        sizer.Add(self.__cbShowStereotype, 0, wx.ALL, GAP)
        sizer.Add(self.__cbShowFields,     0, wx.ALL, GAP)
        sizer.Add(self.__cbShowMethods,    0, wx.ALL, GAP)

        # Add second Vertical sizer
        hs = wx.BoxSizer(wx.HORIZONTAL)
        btnOk = wx.Button(self, wx.ID_OK, _("&OK"))
        hs.Add(btnOk, 0, wx.ALL, GAP)
        sizer.Add(hs, 0, wx.CENTER)

        self.__changed = 0

        # Layout
        self.SetAutoLayout(True)
        self.SetSizer(sizer)
        sizer.Fit(self)
        sizer.SetSizeHints(self)

        # Callbacks
        self.Bind(EVT_CHECKBOX, self.__showParamsID, self.__OnCheckBox)
        self.Bind(EVT_BUTTON, wx.ID_OK, self.__OnCmdOk)

        # Set all values
        self.__setValues()

    #>------------------------------------------------------------------------

    def __setValues(self):
        """
        Set the default values to the controls.

        @since 1.0
        """
        def secureInt(x):
            if x is None:
                return 0
            else:
                return int(x)

    #>------------------------------------------------------------------------

    def __OnCheckBox(self, event):
        """
        Callback.

        @since 1.0
        """
        self.__changed = 1
        id = event.GetId()
        val = event.IsChecked()

    #>------------------------------------------------------------------------

    def __OnChoice(self, event):
        """
        Callback.

        @since 1.0
        """
        pass

    #>------------------------------------------------------------------------

    def __OnClose(self, event):
        """
        Callback.

        @since 1.2
        """
        event.Skip()

    #>------------------------------------------------------------------------

    def __OnCmdOk(self, event):
        """
        Callback.

        @since 1.2
        """
        #if self.__changed:
        #    for oglObject in self.__ctrl.getUmlObjects():
        #        if isinstance(oglObject, OglClass):
        #            self.__ctrl.autoResize(oglObject)

        self.Close()

    #>------------------------------------------------------------------------
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.