Beispiel #1
0
void FlexChildFrame::OnSetFocus(wxFocusEvent &)
{
    if (listCtrl)
    {
        listCtrl->SetFocus();
        UpdateFrom(NotifyId::UpdateStatusBar);
    }
}
Beispiel #2
0
void FlexChildFrame::OnActivate(wxActivateEvent &event)
{
    if (event.GetActive() && listCtrl)
    {
        listCtrl->SetFocus();
        UpdateFrom(NotifyId::UpdateStatusBar);
    }
}
Beispiel #3
0
FlexChildFrame::FlexChildFrame(
    wxMDIParentFrame *parent,
    const wxString &title,
    const wxPoint &pos,
    const wxSize &size,
    const long style,
    FileContainerIf *container) :
    wxMDIChildFrame(parent, -1, title, pos, size, style),
    listCtrl(nullptr)
{
    // Give it an icon
#ifdef __WXMSW__
    SetIcon(wxIcon("CONTAINER_ICON"));
#else
    SetIcon(wxIcon(contain_xpm));
#endif


    // create a list control
    int width, height;
    GetClientSize(&width, &height);
    listCtrl = std::unique_ptr<FlexDiskListCtrl>(new FlexDiskListCtrl(
        this, LIST_CTRL, wxPoint(0, 0), wxSize(width, height),
        wxLC_REPORT | /*wxLC_EDIT_LABELS |*/ wxSUNKEN_BORDER |
        wxVSCROLL | wxHSCROLL, container));

    wxLayoutConstraints *c = new wxLayoutConstraints;
    c->top.SameAs(this, wxTop);
    c->left.SameAs(this, wxLeft);
    c->width.SameAs(this, wxWidth);
    c->height.SameAs(this, wxHeight);
    listCtrl->SetConstraints(c);

    wxMenuBar  *pMenuBar = new wxMenuBar(wxMB_DOCKABLE);

    pMenuBar->Append(FlexMenuFactory::CreateFileMenu(), _("&File"));
    pMenuBar->Append(FlexMenuFactory::CreateEditMenu(), _("&Edit"));
    pMenuBar->Append(FlexMenuFactory::CreateContainerMenu(), _("&Container"));
    pMenuBar->Append(FlexMenuFactory::CreateExtrasMenu(), _("&Extras"));
    pMenuBar->Append(FlexMenuFactory::CreateHelpMenu(), _("&Help"));

    SetMenuBar(pMenuBar);

#ifdef __WXMSW__
    // create a status bar
    wxStatusBar *statusBar = this->CreateStatusBar(3);

    const int fieldWidth[3] = { 300, -1, -1 };
    statusBar->SetFieldsCount(3, fieldWidth);

    // Attach itself for statusbar update
    listCtrl->Attach(*this);
    UpdateFrom(NotifyId::UpdateStatusBar);
#endif
}
Beispiel #4
0
Settings::Settings()
	:
	fMessage(kMsgFileTypesSettings),
	fUpdated(false)
{
	_SetDefaults();

	BFile file;
	if (_Open(&file, B_READ_ONLY) != B_OK)
		return;

	BMessage settings;
	if (settings.Unflatten(&file) == B_OK) {
		// We don't unflatten into our default message to make sure
		// nothing is lost (because of old or corrupted on disk settings)
		UpdateFrom(&settings);
		fUpdated = false;
	}
}