bool Window_Selectable::ApplyContent(int _item_width){ // 選択肢のサイズを設定 UpdateSelectableSize(); // 項目間のマージンを指定(最初に省略した場合) if(item_marginx == -1){ item_marginx = fontBandle.fontSize*2; } // 項目の最大サイズを指定 item_width = _item_width==-1 ? (GetContentMaxDrawWidth()+fontBandle.fontSize) : _item_width; content_width = item_width*column+item_marginx*(column-1); // タイトルの幅を指定 int title_width = GetDrawStringWidthToHandle( title, strlen(title), titleFontSize.hFont); // 項目の幅とタイトルの幅のうち大きいほうを実際の幅に指定 contentArea.w = max(content_width, title_width); // タイトルも含めたコンテンツの大きさを指定 contentArea.h = fontBandle.lineHeight*(select.row-1) + fontBandle.fontSize; contentArea.h += (useTitle ? titleFontSize.lineHeight : 0); return true; }
void Window_Selectable::Setup_FixContentWidth_Auto( WindowSkin* _pSkin, WINDOWAREA _frameArea, int _py, WINDOWFONT _font, int _item_margin_x){ windowFont = _font; item_width = GetContentMaxDrawWidth(); Window_Text::Setup_FixContentWidth( _pSkin, _frameArea, item_width + _item_margin_x*(column-1), _py, true); }