Module CubeColourDialog :: Class CubeColourDialog
[hide private]
[frames] | no frames]

Class CubeColourDialog

source code

     object --+                    
              |                    
wx._core.Object --+                
                  |                
wx._core.EvtHandler --+            
                      |            
        wx._core.Window --+        
                          |        
 wx._windows.TopLevelWindow --+    
                              |    
             wx._windows.Dialog --+
                                  |
                                 CubeColourDialog

This is the CubeColourDialog main class implementation.

Instance Methods [hide private]
  __init__(self, parent, colourData=None, style=CCD_SHOW_ALPHA)
Default class constructor.
  SetProperties(self)
Sets some initial properties (sizes, values).
  DoLayout(self)
Layouts all the controls in the CubeColourDialog.
  InitDialog(self)
Initialize the CubeColourDialog.
  CalcSlopes(self)
Calculates the line slopes in the RGB colour cube.
  CalcCuboid(self)
Calculates the RGB colour cube vertices.
  CalcRects(self)
Calculates the brightness control user-selected rect.
  DrawMarkers(self, dc=None)
Draws the markers for all the controls.
  DrawRGB(self)
Refreshes the RGB colour cube.
  DrawHSB(self)
Refreshes the HSB colour wheel.
  DrawBright(self)
Refreshes the brightness control.
  DrawAlpha(self)
Refreshes the alpha channel control.
  SetSpinVals(self)
Sets the values for all the spin controls.
  SetPanelColours(self)
Assigns colours to the colour panels.
  SetCodes(self)
Sets the HTML/MS Access codes (if any) in the text controls.
  OnCloseWindow(self, event)
User canceled the dialog.
  ShowModal(self)
Overridden wx.Dialog.ShowModal.
  SetWindowStyleFlag(self, style)
Sets the CubeColourDialog window style flags.
  OnOk(self, event)
Handles the Ok wx.EVT_BUTTON event for CubeColourDialog.
  OnCancel(self, event)
Handles the Cancel wx.EVT_BUTTON event for CubeColourDialog.
  OnShowAlpha(self, event)
Shows/hides the alpha channel control in CubeColourDialog.
  OnSpinCtrl(self, event)
Handles the wx.EVT_SPINCTRL event for RGB and HSB colours.
  OnAlphaSpin(self, event)
Handles the wx.EVT_SPINCTRL event for the alpha channel.
  AssignColourValue(self, attribute, colourVal, maxVal, position)
Common code to handle spin control changes.
  DrawAll(self)
Draws all the custom controls after a colour change.
  GetColourData(self)
Returns a wxPython compatible wx.ColourData.
  GetRGBAColour(self)
Returns a 4-elements tuple of red, green, blue, alpha components.
  GetHSVAColour(self)
Returns a 4-elements tuple of hue, saturation, brightness, alpha components.

Inherited from wx._windows.Dialog: Create, CreateButtonSizer, CreateSeparatedButtonSizer, CreateStdDialogButtonSizer, CreateTextSizer, EndModal, GetAffirmativeId, GetEscapeId, GetReturnCode, IsModal, SetAffirmativeId, SetEscapeId, SetReturnCode

Inherited from wx._windows.Dialog (private): _CreateButtonSizer

Inherited from wx._windows.TopLevelWindow: CenterOnScreen, CentreOnScreen, EnableCloseButton, GetDefaultItem, GetIcon, GetTitle, GetTmpDefaultItem, Iconize, IsActive, IsAlwaysMaximized, IsFullScreen, IsIconized, IsMaximized, MacGetMetalAppearance, MacSetMetalAppearance, Maximize, RequestUserAttention, Restore, SetDefaultItem, SetIcon, SetIcons, SetShape, SetTitle, SetTmpDefaultItem, ShowFullScreen, __repr__

Inherited from wx._core.Window: AcceptsFocus, AcceptsFocusFromKeyboard, AddChild, AdjustForLayoutDirection, AssociateHandle, CacheBestSize, CanSetTransparent, CaptureMouse, Center, CenterOnParent, Centre, CentreOnParent, ClearBackground, ClientToScreen, ClientToScreenXY, Close, ConvertDialogPointToPixels, ConvertDialogSizeToPixels, ConvertPixelPointToDialog, ConvertPixelSizeToDialog, DLG_PNT, DLG_SZE, Destroy, DestroyChildren, Disable, DissociateHandle, DragAcceptFiles, Enable, FindWindowById, FindWindowByName, Fit, FitInside, Freeze, GetAcceleratorTable, GetAdjustedBestSize, GetAutoLayout, GetBackgroundColour, GetBackgroundStyle, GetBestFittingSize, GetBestSize, GetBestSizeTuple, GetBestVirtualSize, GetBorder, GetCaret, GetCharHeight, GetCharWidth, GetChildren, GetClientAreaOrigin, GetClientRect, GetClientSize, GetClientSizeTuple, GetConstraints, GetContainingSizer, GetCursor, GetDefaultAttributes, GetDropTarget, GetEffectiveMinSize, GetEventHandler, GetExtraStyle, GetFont, GetForegroundColour, GetFullTextExtent, GetGrandParent, GetHandle, GetHelpText, GetHelpTextAtPoint, GetId, GetLabel, GetLayoutDirection, GetMaxHeight, GetMaxSize, GetMaxWidth, GetMinHeight, GetMinSize, GetMinWidth, GetName, GetParent, GetPosition, GetPositionTuple, GetRect, GetScreenPosition, GetScreenPositionTuple, GetScreenRect, GetScrollPos, GetScrollRange, GetScrollThumb, GetSize, GetSizeTuple, GetSizer, GetTextExtent, GetThemeEnabled, GetToolTip, GetTopLevelParent, GetUpdateClientRect, GetUpdateRegion, GetValidator, GetVirtualSize, GetVirtualSizeTuple, GetWindowBorderSize, GetWindowStyle, GetWindowStyleFlag, GetWindowVariant, HasCapture, HasFlag, HasMultiplePages, HasScrollbar, HasTransparentBackground, Hide, HitTest, HitTestXY, InheritAttributes, InheritsBackgroundColour, InvalidateBestSize, IsBeingDeleted, IsDoubleBuffered, IsEnabled, IsExposed, IsExposedPoint, IsExposedRect, IsFrozen, IsRetained, IsShown, IsShownOnScreen, IsTopLevel, Layout, LineDown, LineUp, Lower, MakeModal, Move, MoveAfterInTabOrder, MoveBeforeInTabOrder, MoveXY, Navigate, OnPaint, PageDown, PageUp, PopEventHandler, PopupMenu, PopupMenuXY, PostCreate, PrepareDC, PushEventHandler, Raise, Refresh, RefreshRect, RegisterHotKey, ReleaseMouse, RemoveChild, RemoveEventHandler, Reparent, ScreenToClient, ScreenToClientXY, ScrollLines, ScrollPages, ScrollWindow, SendSizeEvent, SetAcceleratorTable, SetAutoLayout, SetBackgroundColour, SetBackgroundStyle, SetBestFittingSize, SetCaret, SetClientRect, SetClientSize, SetClientSizeWH, SetConstraints, SetContainingSizer, SetCursor, SetDimensions, SetDoubleBuffered, SetDropTarget, SetEventHandler, SetExtraStyle, SetFocus, SetFocusFromKbd, SetFont, SetForegroundColour, SetHelpText, SetHelpTextForId, SetId, SetInitialSize, SetLabel, SetLayoutDirection, SetMaxSize, SetMinSize, SetName, SetOwnBackgroundColour, SetOwnFont, SetOwnForegroundColour, SetPosition, SetRect, SetScrollPos, SetScrollbar, SetSize, SetSizeHints, SetSizeHintsSz, SetSizeWH, SetSizer, SetSizerAndFit, SetThemeEnabled, SetToolTip, SetToolTipString, SetTransparent, SetValidator, SetVirtualSize, SetVirtualSizeHints, SetVirtualSizeHintsSz, SetVirtualSizeWH, SetWindowStyle, SetWindowVariant, ShouldInheritColours, Show, Thaw, ToggleWindowStyle, TransferDataFromWindow, TransferDataToWindow, UnregisterHotKey, Update, UpdateWindowUI, UseBgCol, Validate, WarpPointer

Inherited from wx._core.EvtHandler: AddPendingEvent, Bind, Connect, Disconnect, GetEvtHandlerEnabled, GetNextHandler, GetPreviousHandler, ProcessEvent, ProcessPendingEvents, SetEvtHandlerEnabled, SetNextHandler, SetPreviousHandler, Unbind

Inherited from wx._core.EvtHandler (private): _setOORInfo

Inherited from wx._core.Object: GetClassName, IsSameAs

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__


Static Methods [hide private]

Inherited from wx._windows.Dialog: GetClassDefaultAttributes

Inherited from wx._core.Window: FindFocus, GetCapture, NewControlId, NextControlId, PrevControlId


Class Variables [hide private]

Inherited from wx._windows.Dialog: ButtonSizerFlags


Properties [hide private]

Inherited from wx._windows.Dialog: AffirmativeId, EscapeId, ReturnCode, thisown

Inherited from wx._windows.TopLevelWindow: DefaultItem, Icon, Title, TmpDefaultItem

Inherited from wx._core.Window: AcceleratorTable, AutoLayout, BackgroundColour, BackgroundStyle, BestSize, BestVirtualSize, Border, Caret, CharHeight, CharWidth, Children, ClientAreaOrigin, ClientRect, ClientSize, Constraints, ContainingSizer, Cursor, DefaultAttributes, DropTarget, EffectiveMinSize, Enabled, EventHandler, ExtraStyle, Font, ForegroundColour, GrandParent, Handle, HelpText, Id, Label, LayoutDirection, MaxHeight, MaxSize, MaxWidth, MinHeight, MinSize, MinWidth, Name, Parent, Position, Rect, ScreenPosition, ScreenRect, Shown, Size, Sizer, ThemeEnabled, ToolTip, TopLevel, TopLevelParent, UpdateClientRect, UpdateRegion, Validator, VirtualSize, WindowStyle, WindowStyleFlag, WindowVariant

Inherited from wx._core.EvtHandler: EvtHandlerEnabled, NextHandler, PreviousHandler

Inherited from wx._core.Object: ClassName

Inherited from object: __class__


Method Details [hide private]

__init__(self, parent, colourData=None, style=CCD_SHOW_ALPHA)
(Constructor)

source code 
Default class constructor.
Parameters:
  • colourData - a wxPython wx.ColourData;
  • style - can be either None or CCD_SHOW_ALPHA, depending if you want to hide the alpha channel control or not.
Overrides: wx._windows.Dialog.__init__

SetProperties(self)

source code 
Sets some initial properties (sizes, values).

DoLayout(self)

source code 
Layouts all the controls in the CubeColourDialog.

InitDialog(self)

source code 
Initialize the CubeColourDialog.
Overrides: wx._core.Window.InitDialog

CalcSlopes(self)

source code 
Calculates the line slopes in the RGB colour cube.

CalcCuboid(self)

source code 
Calculates the RGB colour cube vertices.

CalcRects(self)

source code 
Calculates the brightness control user-selected rect.

DrawMarkers(self, dc=None)

source code 
Draws the markers for all the controls.

DrawRGB(self)

source code 
Refreshes the RGB colour cube.

DrawHSB(self)

source code 
Refreshes the HSB colour wheel.

DrawBright(self)

source code 
Refreshes the brightness control.

DrawAlpha(self)

source code 
Refreshes the alpha channel control.

SetSpinVals(self)

source code 
Sets the values for all the spin controls.

SetPanelColours(self)

source code 
Assigns colours to the colour panels.

SetCodes(self)

source code 
Sets the HTML/MS Access codes (if any) in the text controls.

OnCloseWindow(self, event)

source code 
User canceled the dialog.

ShowModal(self)

source code 
Overridden wx.Dialog.ShowModal.
Returns:
int

Overrides: wx._windows.Dialog.ShowModal

SetWindowStyleFlag(self, style)

source code 
Sets the CubeColourDialog window style flags.
Overrides: wx._core.Window.SetWindowStyleFlag

OnOk(self, event)

source code 
Handles the Ok wx.EVT_BUTTON event for CubeColourDialog.

OnCancel(self, event)

source code 
Handles the Cancel wx.EVT_BUTTON event for CubeColourDialog.

OnShowAlpha(self, event)

source code 
Shows/hides the alpha channel control in CubeColourDialog.

OnSpinCtrl(self, event)

source code 
Handles the wx.EVT_SPINCTRL event for RGB and HSB colours.

OnAlphaSpin(self, event)

source code 
Handles the wx.EVT_SPINCTRL event for the alpha channel.

AssignColourValue(self, attribute, colourVal, maxVal, position)

source code 
Common code to handle spin control changes.

DrawAll(self)

source code 
Draws all the custom controls after a colour change.

GetColourData(self)

source code 
Returns a wxPython compatible wx.ColourData.

GetRGBAColour(self)

source code 
Returns a 4-elements tuple of red, green, blue, alpha components.

GetHSVAColour(self)

source code 
Returns a 4-elements tuple of hue, saturation, brightness, alpha components.