comparison window/menuitem.cc @ 65:4416cfac86ae

Convert EUC-JP files to UTF8
author Thibaut Girka <thib@sitedethib.com>
date Fri, 26 Nov 2010 10:53:15 +0100
parents 15a18fbe6f21
children
comparison
equal deleted inserted replaced
64:045ca45f9610 65:4416cfac86ae
89 } 89 }
90 } 90 }
91 91
92 void MenuItem::pack(void) { 92 void MenuItem::pack(void) {
93 int x_min = 0, y_min = 0; 93 int x_min = 0, y_min = 0;
94 if (lb_width == -1) { // 上にラベルを貼る 94 if (lb_width == -1) { // 筝莢若
95 if (lb_left < 0) lb_left = 0; 95 if (lb_left < 0) lb_left = 0;
96 if (lb_bottom < 0) lb_bottom = 0; 96 if (lb_bottom < 0) lb_bottom = 0;
97 if (label && label->Pic()) { 97 if (label && label->Pic()) {
98 label->Pic()->Move(lb_left, 0); 98 label->Pic()->Move(lb_left, 0);
99 y_min = lb_bottom + label->Pic()->Height(); 99 y_min = lb_bottom + label->Pic()->Height();
100 } else { 100 } else {
101 y_min = lb_bottom; 101 y_min = lb_bottom;
102 } 102 }
103 } else { // 左にラベルを貼る 103 } else { // 綏莢若
104 if (lb_right < 0) lb_right = 0; 104 if (lb_right < 0) lb_right = 0;
105 if (label && label->Pic()) { 105 if (label && label->Pic()) {
106 int label_width = label->Pic()->Width(); 106 int label_width = label->Pic()->Width();
107 int label_height = label->Pic()->Height(); 107 int label_height = label->Pic()->Height();
108 if (label_width > lb_width - lb_right) { 108 if (label_width > lb_width - lb_right) {
140 for (i=0; i<y_size; i++) { 140 for (i=0; i<y_size; i++) {
141 height += item_height[i]; 141 height += item_height[i];
142 } 142 }
143 143
144 int x=x_min, y=y_min; 144 int x=x_min, y=y_min;
145 // width / height の再割り当て 145 // width / height 蚊綵
146 if (menu_width > width + x_min) { 146 if (menu_width > width + x_min) {
147 int dif = menu_width - width - x_min; 147 int dif = menu_width - width - x_min;
148 int n = x_size + 1; 148 int n = x_size + 1;
149 x += dif/n; 149 x += dif/n;
150 for (i=0; i<x_size; i++) { 150 for (i=0; i<x_size; i++) {
175 for (i=0; i<y_size; i++) { 175 for (i=0; i<y_size; i++) {
176 item_y[i] = y + item_height[i] / 2; 176 item_y[i] = y + item_height[i] / 2;
177 y += item_height[i]; 177 y += item_height[i];
178 } 178 }
179 } 179 }
180 // 位置の再割り当て 180 // 篏臀蚊綵
181 it = item.begin(); 181 it = item.begin();
182 for (i=0; i<y_size; i++) { 182 for (i=0; i<y_size; i++) {
183 for (j=0; j<x_size; j++) { 183 for (j=0; j<x_size; j++) {
184 if (*it != NULL && (*it)->Pic() != NULL) { 184 if (*it != NULL && (*it)->Pic() != NULL) {
185 PicBase* pic = (*it)->Pic(); 185 PicBase* pic = (*it)->Pic();
188 pic->Move(x0, y0); 188 pic->Move(x0, y0);
189 } 189 }
190 it++; 190 it++;
191 } 191 }
192 } 192 }
193 // 左にラベルがある場合、ラベルの高さ方向のセンタリング 193 // 綏翫蕭劫祉潟帥潟
194 if (label && label->Pic() && lb_width != -1) { 194 if (label && label->Pic() && lb_width != -1) {
195 int label_width = label->Pic()->Width(); 195 int label_width = label->Pic()->Width();
196 int label_height = label->Pic()->Height(); 196 int label_height = label->Pic()->Height();
197 label->Pic()->Move(x_min-label_width-lb_right, (Pic()->Height() - label_height) / 2); 197 label->Pic()->Move(x_min-label_width-lb_right, (Pic()->Height() - label_height) / 2);
198 } 198 }