/******************************************************** * _ENDPOINT-LIST ********************************************************/ _EndpointList::_EndpointList(BRect frame) : inherited(frame, ENDPOINT_LIST_STR, B_FOLLOW_ALL, B_WILL_DRAW, B_NO_BORDER), mLabelTarget(NULL), mDeviceTarget(NULL) { SetSelectionMode(B_SINGLE_SELECTION_LIST); SetSortingEnabled(false); AddColumn( new SeqColoredColumn(MIDI_PORT_STR, 150, 20, 350, B_TRUNCATE_MIDDLE), 0); AddColumn( new SeqColoredColumn(TYPE_STR, 50, 20, 350, B_TRUNCATE_MIDDLE), 1); AddColumn( new SeqColoredColumn(DEVICE_STR, 150, 20, 350, B_TRUNCATE_MIDDLE), 2); AddColumn( new SeqColoredColumn(LABEL_STR, 50, 20, 350, B_TRUNCATE_MIDDLE), 3); int32 id = 0; BMidiProducer* prod; while ((prod=BMidiRoster::NextProducer(&id)) != NULL) { if (prod->IsValid() ) AddEndpoint(prod); } id = 0; BMidiConsumer* cons; while ((cons=BMidiRoster::NextConsumer(&id)) != NULL) { if (cons->IsValid() ) AddEndpoint(cons); } am_studio_endpoint endpt; BString l, m, n; for (uint32 k = 0; AmGlobals().GetStudioInfoAt(k, endpt, &l, &m, &n) == B_OK; k++) { AddChildRow(endpt, &l, &m, &n); } }
void GUI::SwitchMode() { if(mode == DRAWING_MODE) { SetSelectionMode(); } else { SetDrawingMode(); } }
bool GUI::DoRedo() { Editor* editor = GetCurrentEditor(); if(editor && editor->actionQueue->canRedo()) { editor->actionQueue->redo(); if(editor->selection.size() > 0) SetSelectionMode(); SetStatusText(wxT("Redo action")); UpdateMinimap(); root->UpdateMenubar(); root->Refresh(); return true; } return false; }