Mercurial > otakunoraifu
diff scn2k/scn2k_text.cc @ 40:651237260724
* Center button-type selects
author | thib |
---|---|
date | Wed, 18 Mar 2009 16:44:49 +0000 |
parents | de29c4d2d043 |
children | 01aa5ddf7dc8 |
line wrap: on
line diff
--- a/scn2k/scn2k_text.cc +++ b/scn2k/scn2k_text.cc @@ -693,8 +693,9 @@ void TextImpl::CreateSelect(Cmd& cmd) { External_select: CreateSelBG(); hide(); // なので、テキストウィンドウは消去 - int baseposx, baseposy, repposx, repposy; + int baseposx, baseposy, repposx, repposy, centerx, centery; int mojisize, col1, col2; + config.GetParam("#SELBTN.000.CENTERING", 2, ¢erx, ¢ery); config.GetParam("#SELBTN.000.BASEPOS", 2, &baseposx, &baseposy); config.GetParam("#SELBTN.000.REPPOS", 2, &repposx, &repposy); config.GetParam("#SELBTN.000.MOJISIZE", 1, &mojisize); @@ -713,6 +714,10 @@ External_select: /* ウィンドウ背景の大きさを求める */ if (baseposx == 0 && sel_bg_rect.width() != 0) baseposx = (parent.Width()-sel_bg_rect.width()) / 2; // ボタン位置をセンタリング + if (centerx) + baseposx = (parent.Width()-sel_bg_rect.width()-sel_size*repposx) / 2; + if (centery) + baseposy = (parent.Height()-sel_bg_rect.height()-sel_size*repposy) / 2; sel_widget = parent.create_node( Rect(0, 0, parent.Width(), parent.Height()),0);