78 // --------------------------------------------------------------------------- |
78 // --------------------------------------------------------------------------- |
79 // |
79 // |
80 void CBubbleTouchPane::SizeChanged( ) |
80 void CBubbleTouchPane::SizeChanged( ) |
81 { |
81 { |
82 if ( !iButtons.Count() ) |
82 if ( !iButtons.Count() ) |
|
83 { |
83 return; |
84 return; |
84 |
85 } |
|
86 |
85 // button index |
87 // button index |
86 // 1 2 OR 1 2 3 4 |
88 // 1 2 OR 1 2 3 4 |
87 // 3 4 |
89 // 3 4 |
88 TInt i = 0; |
90 TInt buttonInd = 0; |
89 |
91 |
90 TInt rows = 0; |
92 TInt rows = 0; |
91 TInt columns = 0; |
93 TInt columns = 0; |
92 BubbleLayout6::button_grp_row_column_count(0, rows, columns); |
94 BubbleLayout6::button_grp_row_column_count(0, rows, columns); |
93 for ( TInt row = 0; row < rows; row++ ) |
95 if ( Layout_Meta_Data::IsLandscapeOrientation() && |
94 { |
96 !Layout_Meta_Data::IsMirrored() ) |
|
97 { |
|
98 // Set places of the touch buttons so that they correspond places in portrait. |
|
99 // However, don't change order if mirrored display is used. |
95 for ( TInt col = 0; col < columns; col++ ) |
100 for ( TInt col = 0; col < columns; col++ ) |
96 { |
101 { |
97 TAknLayoutRect buttonPane; |
102 for ( TInt row = rows - 1; row >= 0; row-- ) |
98 buttonPane.LayoutRect( |
|
99 Rect(), |
|
100 BubbleLayout6::cell_call6_button_pane(0, col, row) ); |
|
101 |
|
102 if ( i < iButtons.Count() && iButtons[i] ) |
|
103 { |
103 { |
104 // Button control layout according to background |
104 SetButtonLayout( buttonInd, col, row ); |
105 AknLayoutUtils::LayoutControl( |
105 buttonInd++; |
106 iButtons[i], |
|
107 buttonPane.Rect(), |
|
108 BubbleLayout6::button_call6_background_graphics(0)); |
|
109 |
|
110 TAknLayoutText text; |
|
111 text.LayoutText( buttonPane.Rect(), |
|
112 BubbleLayout6::button_call6_function_text(0)); |
|
113 |
|
114 TAknLayoutRect icon; |
|
115 icon.LayoutRect( buttonPane.Rect(), |
|
116 BubbleLayout6::button_call6_function_graphics(0)); |
|
117 |
|
118 iButtons[i]->SetIconSize( icon.Rect().Size() ); |
|
119 iButtons[i++]->SetLayout( text, icon.Rect() ); |
|
120 } |
106 } |
121 } |
107 } |
|
108 } |
|
109 else |
|
110 { |
|
111 for ( TInt row = 0; row < rows; row++ ) |
|
112 { |
|
113 for ( TInt col = 0; col < columns; col++ ) |
|
114 { |
|
115 SetButtonLayout( buttonInd, col, row ); |
|
116 buttonInd++; |
|
117 } |
|
118 } |
|
119 } |
|
120 } |
|
121 |
|
122 // --------------------------------------------------------------------------- |
|
123 // SetButtonLayout |
|
124 // --------------------------------------------------------------------------- |
|
125 // |
|
126 void CBubbleTouchPane::SetButtonLayout( TInt aButtonIndex, TInt aColumn, TInt aRow ) |
|
127 { |
|
128 TAknLayoutRect buttonPane; |
|
129 buttonPane.LayoutRect( |
|
130 Rect(), |
|
131 BubbleLayout6::cell_call6_button_pane(0, aColumn, aRow) ); |
|
132 |
|
133 if ( aButtonIndex < iButtons.Count() && iButtons[aButtonIndex] ) |
|
134 { |
|
135 // Button control layout according to background |
|
136 AknLayoutUtils::LayoutControl( |
|
137 iButtons[aButtonIndex], |
|
138 buttonPane.Rect(), |
|
139 BubbleLayout6::button_call6_background_graphics(0)); |
|
140 |
|
141 TAknLayoutText text; |
|
142 text.LayoutText( buttonPane.Rect(), |
|
143 BubbleLayout6::button_call6_function_text(0)); |
|
144 |
|
145 TAknLayoutRect icon; |
|
146 icon.LayoutRect( buttonPane.Rect(), |
|
147 BubbleLayout6::button_call6_function_graphics(0)); |
|
148 |
|
149 iButtons[aButtonIndex]->SetIconSize( icon.Rect().Size() ); |
|
150 iButtons[aButtonIndex]->SetLayout( text, icon.Rect() ); |
122 } |
151 } |
123 } |
152 } |
124 |
153 |
125 // --------------------------------------------------------------------------- |
154 // --------------------------------------------------------------------------- |
126 // CountComponentControls |
155 // CountComponentControls |