@ -64,40 +64,40 @@ ExerciseFactorize::ExerciseFactorize(TQWidget * parent, const char * name):
Form1Layout = new TQVBoxLayout ( this , 11 , 6 , " Form1Layout " ) ;
tq layout9 = new TQVBoxLayout ( 0 , 0 , 6 , " tq layout9" ) ;
layout9 = new TQVBoxLayout ( 0 , 0 , 6 , " layout9" ) ;
// The following method fix the problem in
// bug #116831, reverse order in RTL desktops.
// Amit Ramon amit.ramon@kdemail.net
tq layout4 = createFactorsLayout ( ) ;
tq layout9- > addLayout ( tq layout4) ;
layout4 = createFactorsLayout ( ) ;
layout9- > addLayout ( layout4) ;
spacer2 = new TQSpacerItem ( 20 , 21 , TQSizePolicy : : Minimum , TQSizePolicy : : Expanding ) ;
tq layout9- > addItem ( spacer2 ) ;
layout9- > addItem ( spacer2 ) ;
tq layout2 = new TQVBoxLayout ( 0 , 0 , 6 , " tq layout2" ) ;
layout2 = new TQVBoxLayout ( 0 , 0 , 6 , " layout2" ) ;
// The following method fix the problem in
// bug #116831, reverse order in RTL desktops.
// Amit Ramon amit.ramon@kdemail.net
tq layout1 = createButtonsLayout ( ) ;
tq layout2- > addLayout ( tq layout1) ;
layout1 = createButtonsLayout ( ) ;
layout2- > addLayout ( layout1) ;
m_removeLastFactorButton = new TQPushButton ( this , " m_removeLastFactorButton " ) ;
tq layout2- > addWidget ( m_removeLastFactorButton ) ;
tq layout9- > addLayout ( tq layout2 ) ;
layout2- > addWidget ( m_removeLastFactorButton ) ;
layout9- > addLayout ( layout2 ) ;
spacer4 = new TQSpacerItem ( 20 , 21 , TQSizePolicy : : Minimum , TQSizePolicy : : Expanding ) ;
tq layout9- > addItem ( spacer4 ) ;
layout9- > addItem ( spacer4 ) ;
tq layout7 = new TQHBoxLayout ( 0 , 0 , 6 , " tq layout7" ) ;
layout7 = new TQHBoxLayout ( 0 , 0 , 6 , " layout7" ) ;
spacer3 = new TQSpacerItem ( 361 , 20 , TQSizePolicy : : Expanding , TQSizePolicy : : Minimum ) ;
tq layout7- > addItem ( spacer3 ) ;
layout7- > addItem ( spacer3 ) ;
m_checkButton = new TQPushButton ( this , " m_checkButton " ) ;
tq layout7- > addWidget ( m_checkButton ) ;
tq layout9- > addLayout ( tq layout7 ) ;
Form1Layout - > addLayout ( tq layout9 ) ;
layout7- > addWidget ( m_checkButton ) ;
layout9- > addLayout ( layout7 ) ;
Form1Layout - > addLayout ( layout9 ) ;
// the current task
TQString tmp_str ;
@ -228,16 +228,16 @@ void ExerciseFactorize::update()
//
// The following method was added to fix
// bug #116831 (reverse tq layout in RTL desktops)
// bug #116831 (reverse layout in RTL desktops)
// Amit Ramon amit.ramon@kdemail.net
//
/** Create the tq layout that hold the exercise widgets
/** Create the layout that hold the exercise widgets
*/
TQHBoxLayout * ExerciseFactorize : : createFactorsLayout ( )
{
// first create all widgets
TQHBoxLayout * tq layout = new TQHBoxLayout ( 0 , 0 , 6 , " tq layout4" ) ;
TQHBoxLayout * layout = new TQHBoxLayout ( 0 , 0 , 6 , " layout4" ) ;
m_taskLabel = new TQLabel ( this , " m_taskLabel " ) ;
@ -258,46 +258,46 @@ TQHBoxLayout* ExerciseFactorize::createFactorsLayout()
spacer1 = new TQSpacerItem ( 25 , 20 , TQSizePolicy : : Expanding ,
TQSizePolicy : : Minimum ) ;
// now add the widgets to the tq layout.
// now add the widgets to the layout.
// if we are in a RTL desktop, add them
// in a reverse order
if ( TQApplication : : reverseLayout ( ) )
{
tq layout- > addItem ( spacer1 ) ;
tq layout- > addWidget ( result_label ) ;
tq layout- > addWidget ( m_factorsWidget ) ;
tq layout- > addWidget ( m_factorsEnteredEdit ) ;
tq layout- > addWidget ( m_equalSignLabel ) ;
tq layout- > addWidget ( m_taskLabel ) ;
layout- > addItem ( spacer1 ) ;
layout- > addWidget ( result_label ) ;
layout- > addWidget ( m_factorsWidget ) ;
layout- > addWidget ( m_factorsEnteredEdit ) ;
layout- > addWidget ( m_equalSignLabel ) ;
layout- > addWidget ( m_taskLabel ) ;
}
else
{
tq layout- > addWidget ( m_taskLabel ) ;
tq layout- > addWidget ( m_equalSignLabel ) ;
tq layout- > addWidget ( m_factorsEnteredEdit ) ;
tq layout- > addWidget ( m_factorsWidget ) ;
tq layout- > addWidget ( result_label ) ;
tq layout- > addItem ( spacer1 ) ;
layout- > addWidget ( m_taskLabel ) ;
layout- > addWidget ( m_equalSignLabel ) ;
layout- > addWidget ( m_factorsEnteredEdit ) ;
layout- > addWidget ( m_factorsWidget ) ;
layout- > addWidget ( result_label ) ;
layout- > addItem ( spacer1 ) ;
}
return tq layout;
return layout;
}
//
// The following method was added to fix
// bug #116831 (reverse tq layout in RTL desktops)
// bug #116831 (reverse layout in RTL desktops)
// Amit Ramon amit.ramon@kdemail.net
//
/** Create the tq layout that hold the exercise widgets
/** Create the layout that hold the exercise widgets
*/
TQGridLayout * ExerciseFactorize : : createButtonsLayout ( )
{
const int _COLS = 4 ; // number of buttons in each row
const int _ROWS = 2 ; // number of rows
TQGridLayout * tq layout = new TQGridLayout ( 0 , 1 , 1 , 0 , 6 , " tq layout1" ) ;
TQGridLayout * layout = new TQGridLayout ( 0 , 1 , 1 , 0 , 6 , " layout1" ) ;
// first row buttons
m_factor2Button = new TQPushButton ( this , " m_factor2Button " ) ;
@ -348,12 +348,12 @@ TQGridLayout* ExerciseFactorize::createButtonsLayout()
for ( int col = 0 ; col < _COLS ; col + + )
{
tq layout- > addWidget ( buttons [ row ] [ buttonIdx ] , row , col ) ;
layout- > addWidget ( buttons [ row ] [ buttonIdx ] , row , col ) ;
buttonIdx + = step ;
}
}
return tq layout;
return layout;
}