summaryrefslogtreecommitdiff
path: root/libopie2/opieui/big-screen/osplitter.cpp
Unidiff
Diffstat (limited to 'libopie2/opieui/big-screen/osplitter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/big-screen/osplitter.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/libopie2/opieui/big-screen/osplitter.cpp b/libopie2/opieui/big-screen/osplitter.cpp
index 89f3793..bcfd3a6 100644
--- a/libopie2/opieui/big-screen/osplitter.cpp
+++ b/libopie2/opieui/big-screen/osplitter.cpp
@@ -26,25 +26,26 @@
26 26
27*/ 27*/
28 28
29#include "osplitter.h" 29#include "osplitter.h"
30 30
31/* OPIE */ 31/* OPIE */
32#include <opie2/otabwidget.h> 32#include <opie2/otabwidget.h>
33 33
34/* QT */ 34/* QT */
35#include <qvaluelist.h> 35#include <qvaluelist.h>
36#include <qvbox.h> 36#include <qvbox.h>
37 37
38using namespace Opie; 38using namespace Opie::Ui;
39using namespace Opie::Ui::Private;
39 40
40/** 41/**
41 * 42 *
42 * This is the constructor of OSplitter 43 * This is the constructor of OSplitter
43 * You might want to call setSizeChange to tell 44 * You might want to call setSizeChange to tell
44 * OSplitter to change its layout when a specefic 45 * OSplitter to change its layout when a specefic
45 * mark was crossed. OSplitter sets a default value. 46 * mark was crossed. OSplitter sets a default value.
46 * 47 *
47 * You cann add widget with addWidget to the OSplitter. 48 * You cann add widget with addWidget to the OSplitter.
48 * OSplitter supports also grouping of Splitters where they 49 * OSplitter supports also grouping of Splitters where they
49 * can share one OTabBar in small screen mode. This can be used 50 * can share one OTabBar in small screen mode. This can be used
50 * for email clients like vies but see the example. 51 * for email clients like vies but see the example.
@@ -159,25 +160,25 @@ void OSplitter::setSizeChange( int width_height )
159 */ 160 */
160void OSplitter::addWidget( OSplitter* split ) 161void OSplitter::addWidget( OSplitter* split )
161{ 162{
162 m_splitter.append( split ); 163 m_splitter.append( split );
163 164
164 /* 165 /*
165 * set tab widget 166 * set tab widget
166 */ 167 */
167 if (m_tabWidget ) 168 if (m_tabWidget )
168 setTabWidget( m_parentTab ); 169 setTabWidget( m_parentTab );
169 else 170 else
170 { 171 {
171 Opie::OSplitterContainer con; 172 OSplitterContainer con;
172 con.widget =split; 173 con.widget =split;
173 addToBox( con ); 174 addToBox( con );
174 } 175 }
175} 176}
176 177
177/* 178/*
178 * If in a tab it should be removed 179 * If in a tab it should be removed
179 * and if in a hbox the reparent kills it too 180 * and if in a hbox the reparent kills it too
180 */ 181 */
181/** 182/**
182 * This removes the splitter again. You currently need to call this 183 * This removes the splitter again. You currently need to call this
183 * before you delete or otherwise you can get mem corruption 184 * before you delete or otherwise you can get mem corruption
@@ -204,25 +205,25 @@ void OSplitter::removeWidget( OSplitter* split)
204 * @param icon The icon of the possible Tab 205 * @param icon The icon of the possible Tab
205 * @param label The label of the possible Tab 206 * @param label The label of the possible Tab
206 */ 207 */
207void OSplitter::addWidget( QWidget* wid, const QString& icon, const QString& label ) 208void OSplitter::addWidget( QWidget* wid, const QString& icon, const QString& label )
208{ 209{
209#ifdef DEBUG 210#ifdef DEBUG
210 if (!wid ) 211 if (!wid )
211 { 212 {
212 qWarning("Widget is not valid!"); 213 qWarning("Widget is not valid!");
213 return; 214 return;
214 } 215 }
215#endif 216#endif
216 Opie::OSplitterContainer cont; 217 OSplitterContainer cont;
217 cont.widget = wid; 218 cont.widget = wid;
218 cont.icon =icon; 219 cont.icon =icon;
219 cont.name = label; 220 cont.name = label;
220 221
221 m_container.append( cont ); 222 m_container.append( cont );
222 223
223 /* 224 /*
224 * 225 *
225 */ 226 */
226 if (!m_splitter.isEmpty() && (m_tabWidget || m_parentTab ) ) 227 if (!m_splitter.isEmpty() && (m_tabWidget || m_parentTab ) )
227 setTabWidget( m_parentTab ); 228 setTabWidget( m_parentTab );
228 else 229 else
@@ -387,39 +388,39 @@ void OSplitter::resizeEvent( QResizeEvent* res )
387 qWarning("Changng to vbox %s", name() ); 388 qWarning("Changng to vbox %s", name() );
388 changeVBox(); 389 changeVBox();
389 mode = false; 390 mode = false;
390 } 391 }
391 392
392 emit sizeChanged(mode, m_orient ); 393 emit sizeChanged(mode, m_orient );
393} 394}
394 395
395/* 396/*
396 * Adds a container to a tab either the parent tab 397 * Adds a container to a tab either the parent tab
397 * or our own 398 * or our own
398 */ 399 */
399void OSplitter::addToTab( const Opie::OSplitterContainer& con ) 400void OSplitter::addToTab( const Opie::Ui::Private::OSplitterContainer& con )
400{ 401{
401 QWidget *wid = con.widget; 402 QWidget *wid = con.widget;
402 // not needed widgetstack will reparent as well wid.reparent(m_tabWidget, wid->getWFlags(), QPoint(0, 0) ); 403 // not needed widgetstack will reparent as well wid.reparent(m_tabWidget, wid->getWFlags(), QPoint(0, 0) );
403 if (m_parentTab ) 404 if (m_parentTab )
404 m_parentTab->addTab( wid, con.icon, con.name ); 405 m_parentTab->addTab( wid, con.icon, con.name );
405 else 406 else
406 m_tabWidget->addTab( wid, con.icon, con.name ); 407 m_tabWidget->addTab( wid, con.icon, con.name );
407} 408}
408 409
409 410
410/* 411/*
411 * adds a container to the box 412 * adds a container to the box
412 */ 413 */
413void OSplitter::addToBox( const Opie::OSplitterContainer& con ) 414void OSplitter::addToBox( const Opie::Ui::Private::OSplitterContainer& con )
414{ 415{
415 QWidget* wid = con.widget; 416 QWidget* wid = con.widget;
416 wid->reparent(m_hbox, 0, QPoint(0, 0) ); 417 wid->reparent(m_hbox, 0, QPoint(0, 0) );
417} 418}
418 419
419 420
420/* 421/*
421 * Removes a widget from the tab 422 * Removes a widget from the tab
422 */ 423 */
423void OSplitter::removeFromTab( QWidget* wid ) 424void OSplitter::removeFromTab( QWidget* wid )
424{ 425{
425 if (m_parentTab ) 426 if (m_parentTab )
@@ -536,25 +537,25 @@ void OSplitter::commonChangeBox()
536 for (ContainerList::Iterator it = m_container.begin(); it != m_container.end(); ++it ) 537 for (ContainerList::Iterator it = m_container.begin(); it != m_container.end(); ++it )
537 { 538 {
538 /* only if parent tab.. m_tabWidgets gets deleted and would do that as well */ 539 /* only if parent tab.. m_tabWidgets gets deleted and would do that as well */
539 if (m_parentTab ) 540 if (m_parentTab )
540 removeFromTab( (*it).widget ); 541 removeFromTab( (*it).widget );
541 qWarning("Adding to box %s", (*it).name.latin1() ); 542 qWarning("Adding to box %s", (*it).name.latin1() );
542 addToBox( (*it) ); 543 addToBox( (*it) );
543 } 544 }
544 for ( OSplitter* split = m_splitter.first(); split; split = m_splitter.next() ) 545 for ( OSplitter* split = m_splitter.first(); split; split = m_splitter.next() )
545 { 546 {
546 /* tell them the world had changed */ 547 /* tell them the world had changed */
547 split->setTabWidget( 0 ); 548 split->setTabWidget( 0 );
548 Opie::OSplitterContainer con; 549 OSplitterContainer con;
549 con.widget = split; 550 con.widget = split;
550 // con.widget = split->m_tabWidget ? static_cast<QWidget*>(split->m_tabWidget) 551 // con.widget = split->m_tabWidget ? static_cast<QWidget*>(split->m_tabWidget)
551 // : static_cast<QWidget*>(split->m_hbox); 552 // : static_cast<QWidget*>(split->m_hbox);
552 addToBox( con ); 553 addToBox( con );
553 } 554 }
554 555
555 556
556 557
557 if (m_parentTab ) 558 if (m_parentTab )
558 m_parentTab->addTab(m_hbox, iconName(), label() ); 559 m_parentTab->addTab(m_hbox, iconName(), label() );
559 else 560 else
560 { 561 {