00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "PreCompiled.h"
00025
00027
00028 #include "TaskPanelView.h"
00029 #include "BitmapFactory.h"
00030 #include "iisTaskPanel/include/iisTaskPanel"
00031 #include <Base/Console.h>
00032
00033 using namespace Gui;
00034 using namespace Gui::DockWnd;
00035
00036
00037
00038
00039 TaskPanelView::TaskPanelView(Gui::Document* pcDocument, QWidget *parent)
00040 : DockWindow(pcDocument,parent)
00041 {
00042 #if QT_VERSION <= 0x040104
00043
00044
00045 Base::Console().SetEnabledMsgType("File", ConsoleMsgType::MsgType_Wrn, false);
00046 Base::Console().SetEnabledMsgType("File", ConsoleMsgType::MsgType_Log, false);
00047 #endif
00048
00049 setWindowTitle(tr( "Task View"));
00050
00051 QGridLayout* gridLayout = new QGridLayout(this);
00052 iisTaskPanel *taskPanel = new iisTaskPanel(this);
00053 iisTaskBox *tb1 = new iisTaskBox(
00054 Gui::BitmapFactory().pixmap("document-new"),QLatin1String("Group of Tasks"),true, this);
00055 taskPanel->addWidget(tb1);
00056 gridLayout->addWidget(taskPanel, 0, 0, 2, 1);
00057
00058 iisIconLabel *i1 = new iisIconLabel(
00059 Gui::BitmapFactory().pixmap("view-zoom-in"), QLatin1String("Do Task 1"), tb1);
00060 tb1->addIconLabel(i1);
00061
00062
00063 iisIconLabel *i2 = new iisIconLabel(
00064 Gui::BitmapFactory().pixmap("view-zoom-out"), QLatin1String("Do Task 2"), tb1);
00065 tb1->addIconLabel(i2);
00066
00067 QHBoxLayout *hbl = new QHBoxLayout();
00068 tb1->groupLayout()->addLayout(hbl);
00069
00070 iisIconLabel *i3 = new iisIconLabel(
00071 Gui::BitmapFactory().pixmap("edit-copy"), QLatin1String("Do Task 3"), tb1);
00072 tb1->addIconLabel(i3, false);
00073 hbl->addWidget(i3);
00074
00075 iisIconLabel *i4 = new iisIconLabel(
00076 Gui::BitmapFactory().pixmap("edit-cut"), QLatin1String("Do Task 4"), tb1);
00077 tb1->addIconLabel(i4, false);
00078 hbl->addWidget(i4);
00079 i4->setColors(Qt::red, Qt::green, Qt::gray);
00080 i4->setFocusPen(QPen());
00081
00082 iisIconLabel *i5 = new iisIconLabel(
00083 Gui::BitmapFactory().pixmap("edit-paste"), QLatin1String("Do Task 5"), tb1);
00084 tb1->addIconLabel(i5);
00085
00086 iisTaskBox *tb2 = new iisTaskBox(
00087 Gui::BitmapFactory().pixmap("document-print"), QLatin1String("Non-expandable Group"), false, this);
00088 taskPanel->addWidget(tb2);
00089
00090 iisIconLabel *i21 = new iisIconLabel(
00091 Gui::BitmapFactory().pixmap("document-new"), QLatin1String("Do Task 2.1"), tb2);
00092 tb2->addIconLabel(i21);
00093
00094 iisIconLabel *i22 = new iisIconLabel(
00095 Gui::BitmapFactory().pixmap("document-open"), QLatin1String("Do Task 2.2"), tb2);
00096 tb2->addIconLabel(i22);
00097 i22->setEnabled(false);
00098
00099 iisIconLabel *i23 = new iisIconLabel(
00100 Gui::BitmapFactory().pixmap("document-save"), QLatin1String("Do Task 2.3"), tb2);
00101 tb2->addIconLabel(i23);
00102
00103 iisTaskBox *tb3 = new iisTaskBox(QPixmap(), QLatin1String("Group without Icons"), true, this);
00104 taskPanel->addWidget(tb3);
00105
00106 iisIconLabel *i31 = new iisIconLabel(QPixmap(), QLatin1String("Do Task 3.1"), tb3);
00107 tb3->addIconLabel(i31);
00108
00109 iisIconLabel *i32 = new iisIconLabel(QPixmap(), QLatin1String("Do Task 3.2"), tb3);
00110 tb3->addIconLabel(i32);
00111
00112 tb3->groupLayout()->addWidget(new QLabel(QLatin1String("Widgets also allowed:"), this));
00113 tb3->groupLayout()->addWidget(new QPushButton(QLatin1String("A Button"), this));
00114
00115
00116 QLabel *l1 = new QLabel(QLatin1String("A group without header"), this);
00117 taskPanel->addWidget(l1);
00118
00119
00120 iisTaskGroup *tb4 = new iisTaskGroup(this);
00121 taskPanel->addWidget(tb4);
00122
00123 iisIconLabel *i41 = new iisIconLabel(
00124 Gui::BitmapFactory().pixmap("system-log-out"), QLatin1String("Do Task 4.1"), tb4);
00125 tb4->addIconLabel(i41);
00126
00127 iisIconLabel *i42 = new iisIconLabel(QPixmap(), QLatin1String("Do Task 4.2"), tb4);
00128 tb4->addIconLabel(i42);
00129
00130 taskPanel->addStretch();
00131 taskPanel->setScheme(iisWinXPTaskPanelScheme::defaultScheme());
00132
00133 tb2->setScheme(iisWinXPTaskPanelScheme2::defaultScheme());
00134 tb3->setScheme(iisWinXPTaskPanelScheme2::defaultScheme());
00135
00136
00137 onUpdate();
00138
00139 Gui::Selection().Attach(this);
00140
00141 #if QT_VERSION <= 0x040104
00142 Base::Console().SetEnabledMsgType("File", ConsoleMsgType::MsgType_Wrn, true);
00143 Base::Console().SetEnabledMsgType("File", ConsoleMsgType::MsgType_Log, true);
00144 #endif
00145 }
00146
00147 TaskPanelView::~TaskPanelView()
00148 {
00149 Gui::Selection().Detach(this);
00150 }
00151
00153 void TaskPanelView::OnChange(Gui::SelectionSingleton::SubjectType &rCaller,
00154 Gui::SelectionSingleton::MessageType Reason)
00155 {
00156 std::string temp;
00157
00158 if (Reason.Type == SelectionChanges::AddSelection) {
00159 }
00160 else if (Reason.Type == SelectionChanges::ClrSelection) {
00161 }
00162 else if (Reason.Type == SelectionChanges::RmvSelection) {
00163 }
00164 else if (Reason.Type == SelectionChanges::RmvSelection) {
00165 }
00166 }
00167
00168 void TaskPanelView::onUpdate(void)
00169 {
00170 }
00171
00172 bool TaskPanelView::onMsg(const char* pMsg)
00173 {
00174
00175 return false;
00176 }
00178
00179 #include "moc_TaskPanelView.cpp"