1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
#define __KVIRC__
#include <tqlayout.h>
#include <tqtoolbutton.h>
#include <tqobjectcleanuphandler.h>
#include <tqpushbutton.h>
#include "kvi_tal_vbox.h"
#include <tqpainter.h>
#include <tqapplication.h>
#include "kvi_toolwindows_container.h"
#include "kvi_iconmanager.h"
KviWindowToolWidget::KviWindowToolWidget(TQWidget * parent, KviWindowToolPageButton* button/*, const char * name, WFlags f*/ )
:TQWidget(parent/*,name,f*/)
{
// m_pContainer=parent;
m_pButton=button;
m_bAutoDelete=1;
m_bHidden=0;
if(m_pButton) m_pButton->setOn(!isHidden());
// m_ObjectHandler.add(button);
// setMinimumWidth(0);
}
KviWindowToolWidget::~KviWindowToolWidget()
{
// unregisterSelf();
// m_ObjectHandler.remove(m_pButton);
}
void KviWindowToolWidget::registerSelf()
{
/* m_pContainer->registerWidget(this);
if(!m_ObjectHandler.isEmpty())
{
if(m_pButton)
m_pButton->setOn(true);
} else {
m_pButton=0;
}*/
}
void KviWindowToolWidget::unregisterSelf()
{
/* if(!m_bHidden)
m_pContainer->unregisterWidget(this);
if(!m_ObjectHandler.isEmpty())
{
if(m_pButton)
m_pButton->setOn(false);
} else {
m_pButton=0;
}*/
}
/*void KviWindowToolWidget::hide()
{
if(m_bAutoDelete==0)
{
unregisterSelf();
m_bHidden=1;
}
TQWidget::hide();
}*/
/*void KviWindowToolWidget::show()
{
if(m_bHidden)
{
registerSelf();
}
TQWidget::show();
m_bHidden=0;
}*/
KviWindowToolPageButton::KviWindowToolPageButton ( int pixon,int pixoff, const TQString & text, TQWidget * parent,bool bOn, const char * name )
:TOOL_PAGE_PARENT(parent)
{
#ifdef COMPILE_USE_QT4
setFlat(true);
setObjectName("kvi_window_tool_button");
setIcon(TQIcon(*(g_pIconManager->getSmallIcon(pixon))));
#else
TQIconSet is1;
is1.setPixmap(*(g_pIconManager->getSmallIcon(pixon)),TQIconSet::Small,TQIconSet::Normal,TQIconSet::On);
is1.setPixmap(*(g_pIconManager->getSmallIcon(pixoff)),TQIconSet::Small,TQIconSet::Normal,TQIconSet::Off);
setIconSet(is1);
setUsesBigPixmap(false);
#endif
setToggleButton(true);
setOn(bOn);
// tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Fixed,TQSizePolicy::Ignored));
}
KviWindowToolPageButton::~KviWindowToolPageButton()
{
}
/*void KviWindowToolPageButton::drawButton ( TQPainter * p)
{
TQPixmap pixmap( height(), width() );
if(isOn())
pixmap.fill(tqcolorGroup().mid());
else
pixmap.fill(tqcolorGroup().button());
TQPainter painter( &pixmap );
TQPixmap icon;
if(isOn())
icon=iconSet()->pixmap(TQIconSet::Small,TQIconSet::Normal,TQIconSet::On);
else
icon=iconSet()->pixmap(TQIconSet::Small,TQIconSet::Normal,TQIconSet::Off);
// Draw the frame
//painter.setPen( tqcolorGroup().mid() );
//if ( m_id != NUM_TABS - 1 ) painter.drawLine( 0, 0, 0, pixmap.height() - 1 );
//painter.drawLine( 0, pixmap.height() - 1, pixmap.width() - 1, pixmap.height() - 1 );
// Draw the text
TQFont font;
TQString str = text();
str.remove("&");
const int textX = pixmap.width() / 2 - TQFontMetrics( font ).width( str ) / 2;
painter.setPen( tqcolorGroup().buttonText() );
const TQRect rect( textX + icon.width() / 2 + 2, 0, pixmap.width(), pixmap.height() );
painter.drawText( rect, TQt::AlignLeft | TQt::AlignVCenter, str );
// Draw the icon
painter.drawPixmap( textX - icon.width() / 2 - 2, pixmap.height() / 2 - icon.height() / 2, icon );
// Paint to widget
p->rotate( -90 );
p->drawPixmap( 1 - pixmap.width(), 0, pixmap );
}*/
|