BButton* _MakeButton(const char* label) { BButton* button = new BButton(label, new BMessage('BOOM')); button->SetExplicitMinSize(BSize(10, 50)); button->SetExplicitMaxSize(BSize(500, 500)); button->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_USE_FULL_HEIGHT)); return button; }
BButton* ScreenWindow::_CreateColumnRowButton(bool columns, bool plus) { BMessage* message = new BMessage(kMsgWorkspaceLayoutChanged); message->AddInt32("delta_x", columns ? (plus ? 1 : -1) : 0); message->AddInt32("delta_y", !columns ? (plus ? 1 : -1) : 0); BButton* button = new BButton(plus ? "+" : "-", message); button->SetFontSize(be_plain_font->Size() * 0.9); BSize size = button->MinSize(); size.width = button->StringWidth("+") + 16; button->SetExplicitMinSize(size); button->SetExplicitMaxSize(size); fWorkspacesButtons[(columns ? 0 : 2) + (plus ? 1 : 0)] = button; return button; }