gehe zur Dokumentation dieser Datei00001
00059
00060
00061 #include "BoxIconShape.h"
00062
00063
00064
00065
00066
00067
00068
00069
00070 void MutBoxIconShape::GetBordersForSizer(int &borderTop, int &borderOther) const
00071 {
00072 const int BORDER = 5;
00073
00074 wxSize s = DoGetBestSize();
00075 DEBUGLOG (other, _T("Best Size: %dx%d"),s.x,s.y);
00076
00077
00078
00079
00080
00081
00082 borderTop = s.y;
00083 borderOther = 0;
00084 }
00085
00086 void MutBoxIconShape::OnDraw (wxDC & dc)
00087 {
00088 DEBUGLOG (other, _T("Checking icon"));
00089
00090 if (!GetIcon().IsOk()) {
00091 SetIcon(GetMutIcon());
00092 DEBUGLOG (other, _T("Checking icon again"));
00093
00094 }
00095 DEBUGLOG (other, _T("Icon ok."));
00096
00097 int x, y;
00098 x = 0;
00099 y = 0;
00100 wxRect size = GetRect();
00101 if (staticText) y += staticText->GetSize().y;
00102 if (GetIcon().IsOk()) {
00103 DEBUGLOG (other, _T("Size: %dx%d"),GetIcon().GetHeight(),
00104 GetIcon().GetWidth());
00105 x = (size.width-GetIcon().GetWidth())/2;
00106 dc.DrawIcon(GetIcon(), x, y);
00107 }
00108
00109 DEBUGLOG (other, _T("Focus %p and this %p"),FindFocus(),this);
00110 if (FindFocus() == this) {
00111 DEBUGLOG (other, _T("Painting Box"));
00112 dc.SetPen(*wxBLACK_PEN);
00113 dc.SetBrush(*wxTRANSPARENT_BRUSH);
00114 dc.DrawRectangle(0,0,size.width,size.height);
00115 }
00116 }
00117
00118 bool MutBoxIconShape::Layout() {
00119 if (!MutIconShape::Layout()) return false;
00120 DEBUGLOG (other, _T(""));
00121 if (staticText) {
00122 staticText->Move(0,0);
00123 staticText->CentreOnParent(wxHORIZONTAL);
00124 }
00125 return true;
00126 }
00127
00128
00129
00130
00131
00132