dockart.cpp File Reference

(r1785/r1769)

#include "framemanager.h"
#include "dockart.h"
#include <wx/settings.h>
#include <wx/dcclient.h>
#include <wx/image.h>

Go to the source code of this file.

Functions

static wxColor wxAuiStepColour (const wxColor &c, int percent)
static wxColor wxAuiLightContrastColour (const wxColour &c)
static wxBitmap wxAuiBitmapFromBits (const unsigned char bits[], int w, int h, const wxColour &color)
static void DrawGradientRectangle (wxDC &dc, const wxRect &rect, const wxColour &start_color, const wxColour &end_color, int direction)


Function Documentation

static void DrawGradientRectangle wxDC &  dc,
const wxRect &  rect,
const wxColour &  start_color,
const wxColour &  end_color,
int  direction
[static]
 

Definition at line 78 of file dockart.cpp.

00083 {
00084     int rd, gd, bd, high = 0;
00085     rd = end_color.Red() - start_color.Red();
00086     gd = end_color.Green() - start_color.Green();
00087     bd = end_color.Blue() - start_color.Blue();
00088 
00089     if (direction == wxAUI_GRADIENT_VERTICAL)
00090         high = rect.GetHeight()-1;
00091          else
00092         high = rect.GetWidth()-1;
00093 
00094     for (int i = 0; i <= high; ++i)
00095     {
00096         int r = start_color.Red() +  ((i*rd*100)/high)/100;
00097         int g = start_color.Green() + ((i*gd*100)/high)/100;
00098         int b = start_color.Blue() + ((i*bd*100)/high)/100;
00099 
00100         wxPen p(wxColor((unsigned char)r,
00101                         (unsigned char)g,
00102                         (unsigned char)b));
00103         dc.SetPen(p);
00104 
00105         if (direction == wxAUI_GRADIENT_VERTICAL)
00106             dc.DrawLine(rect.x, rect.y+i, rect.x+rect.width, rect.y+i);
00107              else
00108             dc.DrawLine(rect.x+i, rect.y, rect.x+i, rect.y+rect.height);
00109     }
00110 
00111 }

static wxBitmap wxAuiBitmapFromBits const unsigned char  bits[],
int  w,
int  h,
const wxColour &  color
[static]
 

Definition at line 67 of file dockart.cpp.

00069 {
00070     wxImage img = wxBitmap((const char*)bits, w, h).ConvertToImage();
00071     img.Replace(255,255,255,123,123,123);
00072     img.Replace(0,0,0,color.Red(),color.Green(),color.Blue());
00073     img.SetMaskColour(123,123,123);
00074     return wxBitmap(img);
00075 }

static wxColor wxAuiLightContrastColour const wxColour &  c  )  [static]
 

Definition at line 53 of file dockart.cpp.

00054 {
00055     int amount = 120;
00056 
00057     // if the color is especially dark, then
00058     // make the contrast even lighter
00059     if (c.Red() < 128 && c.Green() < 128 && c.Blue() < 128)
00060         amount = 160;
00061 
00062     return wxAuiStepColour(c, amount);
00063 }

static wxColor wxAuiStepColour const wxColor &  c,
int  percent
[static]
 

Definition at line 45 of file dockart.cpp.

00046 {
00047     int r = c.Red(), g = c.Green(), b = c.Blue();
00048     return wxColour((unsigned char)wxMin((r*percent)/100,255),
00049                     (unsigned char)wxMin((g*percent)/100,255),
00050                     (unsigned char)wxMin((b*percent)/100,255));
00051 }


Generated on Sat Nov 10 03:49:37 2007 for Camelot by  doxygen 1.4.4