bool
CFileSystemDialogImp::OnItemDblClicked( const CEGUI::EventArgs& e )
{GUCE_TRACE;
            
    // Test if this was a left mouse click
    const CEGUI::MouseEventArgs& eData = static_cast< const CEGUI::MouseEventArgs& >( e );    
    if ( eData.button == CEGUI::LeftButton )
    {
        // Get some easy access to data
        CGridViewImp* fsView = static_cast< CGridViewImp* >( GetFileSystemGridView() );
        CEGUI::MultiColumnList* fsViewWidget = fsView->GetImplementationWidget();        

        UInt32 columnIndex = 0;
        UInt32 rowIndex = 0;
        if ( fsView->TestForItemHit( eData.position.d_x , 
                                     eData.position.d_y ,
                                     columnIndex        ,
                                     rowIndex           ) )
        {        
            CEGUI::ListboxItem* listItem = fsViewWidget->getItemAtGridReference( CEGUI::MCLGridRef( rowIndex, columnIndex ) );
            if ( NULL != listItem )
            {
                if ( listItem->getText() == ".." )
                {
                    // ".." means go up one dir
                    m_currentPath = GUCEF::CORE::StripLastSubDir( m_currentPath );
                    RefreshView();
                }
                else
                if ( IsItemADirectory( listItem->getText().c_str() ) )
                {
                    GUCEF::CORE::AppendToPath( m_currentPath, listItem->getText().c_str() );
                    RefreshView();
                }
                else
                if ( IsItemAnArchive( listItem->getText().c_str() ) )
                {
                    CString itemName( listItem->getText().c_str() );
                    CString realName = itemName.CutChars( 3, true );
                    GUCEF::CORE::AppendToPath( m_currentPath, realName );
                    RefreshView();
                }
            }
        }
    }
    
    return true;
}
Beispiel #2
0
void Room_Resv_Edit_Ui::SetActiveReservation( QPointer<Room_Reservation> resv )
{
    currentResv = resv;

    qDebug() << "QQQ (" << resv << ")";


    if ( currentResv->HasCustomer() )
    {
        SetActiveCustomer( currentResv->GetCustomer() );
    }
    else
    {
        currentCustomer = 0;
    }

    if ( currentResv->HasGuests() )
    {
        SetActiveGuest( currentResv->GetGuest() );
    }
    else
    {
        currentGuest = 0;
    }

    RefreshView();
}
Beispiel #3
0
bool
dlgTaskPointShowModal(OrderedTask **task,
                      const unsigned index)
{
  ordered_task = *task;
  task_modified = false;
  active_index = index;

  wf = LoadDialog(CallBackTable, UIGlobals::GetMainWindow(),
                  Layout::landscape ? _T("IDR_XML_TASKPOINT_L") :
                                      _T("IDR_XML_TASKPOINT"));
  assert(wf != nullptr);

  wTaskView = (WndFrame*)wf->FindByName(_T("frmTaskView"));
  assert(wTaskView != nullptr);

  dock = (DockWindow *)wf->FindByName(_T("properties"));
  assert(dock != nullptr);

  RefreshView();
  if (wf->ShowModal() == mrOK)
    ReadValues();

  delete wf;

  if (*task != ordered_task) {
    *task = ordered_task;
    task_modified = true;
  } 
  if (task_modified) {
    ordered_task->ClearName();
    ordered_task->UpdateGeometry();
  }
  return task_modified;
}
Beispiel #4
0
void
TaskListPanel::DeleteTask()
{
  const TCHAR *fname = get_cursor_name();
  tstring upperstring = fname;
  std::transform(upperstring.begin(), upperstring.end(), upperstring.begin(),
      ::toupper);

  if (upperstring.find(_T(".CUP")) != tstring::npos) {
    MessageBoxX(_("Can't delete .CUP files"), _("Delete Error"),
        MB_ICONEXCLAMATION);
    return;
  }


  tstring text = _("Delete the selected task?");
  text += _T("\n(");
  text += fname;
  text += _T(")");

  if (MessageBoxX(text.c_str(), _("Task Browser"),
                  MB_YESNO | MB_ICONQUESTION) != IDYES)
    return;

  TCHAR path[MAX_PATH];
  LocalPath(path, fname);
  File::Delete(path);

  task_store->Scan();
  RefreshView();
}
Beispiel #5
0
static void OnListClicked(WndButton &Sender)
{
  (void)Sender;
  task_modified |= dlgTaskListShowModal(*parent_window, &ordered_task);
  if (task_modified)
    RefreshView();
}
Beispiel #6
0
void
TaskListPanel::OnManageClicked()
{
  dlgTaskManager::TaskViewRestore(wTaskView);
  browse_tabbed->SetCurrentPage(0);
  RefreshView();
}
Beispiel #7
0
void
TaskListPanel::RenameTask()
{
  const unsigned cursor_index = GetList().GetCursorIndex();
  if (cursor_index >= task_store->Size())
    return;

  const TCHAR *oldname = task_store->GetName(cursor_index);
  StaticString<40> newname(oldname);

  if (ClearSuffix(newname.buffer(), _T(".cup"))) {
    ShowMessageBox(_("Can't rename .CUP files"), _("Rename Error"),
        MB_ICONEXCLAMATION);
    return;
  }

  ClearSuffix(newname.buffer(), _T(".tsk"));

  if (!TextEntryDialog(newname))
    return;

  newname.append(_T(".tsk"));

  TCHAR newpath[MAX_PATH];
  LocalPath(newpath, _T("tasks"));
  Directory::Create(newpath);
  LocalPath(newpath, _T("tasks"), newname.c_str());

  File::Rename(task_store->GetPath(cursor_index), newpath);

  task_store->Scan(more);
  RefreshView();
}
Beispiel #8
0
void
TaskListPanel::DeleteTask()
{
  const unsigned cursor_index = GetList().GetCursorIndex();
  if (cursor_index >= task_store->Size())
    return;

  const TCHAR *path = task_store->GetPath(cursor_index);
  if (StringEndsWithIgnoreCase(path, _T(".cup"))) {
    ShowMessageBox(_("Can't delete .CUP files"), _("Error"),
                   MB_OK | MB_ICONEXCLAMATION);
    return;
  }

  const TCHAR *fname = task_store->GetName(cursor_index);

  StaticString<1024> text;
  text.Format(_T("%s\n(%s)"), _("Delete the selected task?"), fname);
  if (ShowMessageBox(text.c_str(), _("Task Browser"),
                  MB_YESNO | MB_ICONQUESTION) != IDYES)
    return;

  File::Delete(path);

  task_store->Scan(more);
  RefreshView();
}
Beispiel #9
0
void
TaskListPanel::LoadTask()
{
  const OrderedTask* orig = get_cursor_task();
  if (orig == nullptr)
    return;

  StaticString<1024> text;
  text.Format(_T("%s\n(%s)"), _("Load the selected task?"),
              get_cursor_name());

  if (ShowMessageBox(text.c_str(), _("Task Browser"),
                  MB_YESNO | MB_ICONQUESTION) != IDYES)
    return;

  // create new task first to guarantee pointers are different
  OrderedTask* temptask = orig->Clone(CommonInterface::GetComputerSettings().task);
  delete *active_task;
  *active_task = temptask;

  const unsigned cursor_index = GetList().GetCursorIndex();
  (*active_task)->SetName(StaticString<64>(task_store->GetName(cursor_index)));

  RefreshView();
  *task_modified = true;

  dialog.SwitchToEditTab();
}
Beispiel #10
0
void
TaskListPanel::LoadTask()
{
  const OrderedTask* orig = get_cursor_task();
  if (orig == NULL)
    return;

  tstring text = _("Load the selected task?");
  text += _T("\n(");
  text += get_cursor_name();
  text += _T(")");

  if (MessageBoxX(text.c_str(), _("Task Browser"),
                  MB_YESNO | MB_ICONQUESTION) != IDYES)
    return;

  // create new task first to guarantee pointers are different
  OrderedTask* temptask = protected_task_manager->TaskCopy(*orig);
  delete *active_task;
  *active_task = temptask;
  RefreshView();
  *task_modified = true;

  tab_bar.SetCurrentPage(dlgTaskManager::GetTurnpointTab());
  tab_bar.set_focus();
}
Beispiel #11
0
void
TaskListPanel::RenameTask()
{
  const TCHAR *oldname = get_cursor_name();
  StaticString<40> newname(oldname);

  if (ClearSuffix(newname.buffer(), _T(".cup"))) {
    MessageBoxX(_("Can't rename .CUP files"), _("Rename Error"),
        MB_ICONEXCLAMATION);
    return;
  }

  ClearSuffix(newname.buffer(), _T(".tsk"));

  if (!TextEntryDialog(*(SingleWindow *)wf.get_root_owner(), newname))
    return;

  newname.append(_T(".tsk"));

  TCHAR oldpath[MAX_PATH];
  TCHAR newpath[MAX_PATH];
  LocalPath(oldpath, oldname);
  LocalPath(newpath, newname.c_str());

  File::Rename(oldpath, newpath);

  task_store->Scan();
  RefreshView();
}
void
OptionStartsWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  CreateList(parent, UIGlobals::GetDialogLook(),
             rc, Layout::GetMaximumControlHeight());

  RefreshView();
}
/**
 * displays dlgTaskOptionalStarts
 * @param Sender
 */
static void
OnOptionalStartsClicked(gcc_unused WndButton &Sender)
{
  if (dlgTaskOptionalStarts(wf->GetMainWindow(), &ordered_task)) {
    task_modified =true;
    RefreshView();
  }
}
static void
OnTypeClicked(gcc_unused WndButton &Sender)
{
  if (dlgTaskPointType(wf->GetMainWindow(), &ordered_task, active_index)) {
    task_modified = true;
    RefreshView();
  }
}
Beispiel #15
0
inline void
TaskPointWidget::OnNextClicked()
{
  if (active_index >= ordered_task.TaskSize() - 1 || !ReadValues())
    return;

  ++active_index;
  RefreshView();
}
Beispiel #16
0
void
TaskListPanel::Show(const PixelRect &rc)
{
  browse_tabbed->SetCurrentPage(0);
  wTasks->SetCursorIndex(0); // so Save & Declare are always available
  dlgTaskManager::TaskViewRestore(wTaskView);
  RefreshView();
  XMLWidget::Show(rc);
}
Beispiel #17
0
void
TaskEditPanel::OnMakeFinish()
{
  ordered_task->UpdateStatsGeometry();
  if (ordered_task->GetFactory().CheckAddFinish())
    ordered_task->UpdateGeometry();

  RefreshView();
}
Beispiel #18
0
inline void
TaskPointWidget::OnPreviousClicked()
{
  if (active_index == 0 || !ReadValues())
    return;

  --active_index;
  RefreshView();
}
Beispiel #19
0
static void
OnPreviousClicked()
{
  if (active_index == 0 || !ReadValues())
    return;

  --active_index;
  RefreshView();
}
Beispiel #20
0
static void
OnNextClicked()
{
  if (active_index >= ordered_task->TaskSize() - 1 || !ReadValues())
    return;

  ++active_index;
  RefreshView();
}
Beispiel #21
0
/**
 * displays dlgTaskOptionalStarts
 * @param Sender
 */
static void
OnOptionalStartsClicked()
{
  if (dlgTaskOptionalStarts(&ordered_task)) {
    ordered_task->ClearName();
    task_modified = true;
    RefreshView();
  }
}
Beispiel #22
0
inline void
TaskPointWidget::OnTypeClicked()
{
  if (dlgTaskPointType(&ordered_task, active_index)) {
    ordered_task->ClearName();
    task_modified = true;
    RefreshView();
  }
}
Beispiel #23
0
/**
 * displays dlgTaskOptionalStarts
 * @param Sender
 */
inline void
TaskPointWidget::OnOptionalStartsClicked()
{
  if (dlgTaskOptionalStarts(&ordered_task)) {
    ordered_task->ClearName();
    task_modified = true;
    RefreshView();
  }
}
Beispiel #24
0
void GUI::SelectBrush()
{
	if(palettes.empty())
		return;

	SelectBrushInternal(palettes.front()->GetSelectedBrush());

	RefreshView();
}
Beispiel #25
0
void
TaskListPanel::OnMoreClicked()
{
  more = !more;

  more_button->SetCaption(more ? _("Less") : _("More"));

  task_store->Scan(more);
  RefreshView();
}
Beispiel #26
0
/**
 * displays dlgTaskOptionalStarts
 * @param Sender
 */
inline void
TaskPointWidget::OnOptionalStartsClicked()
{
  if (dlgTaskOptionalStarts(ordered_task)) {
    ordered_task.ClearName();
    ordered_task.UpdateGeometry();
    task_modified = true;
    RefreshView();
  }
}
Beispiel #27
0
bool
pnlTaskProperties::OnTabPreShow(TabBarControl::EventType EventType)
{
  ordered_task = *ordered_task_pointer;
  orig_taskType = ordered_task->get_factory_type();
  LoadFormProperty(*wf, _T("prpTaskType"),
      (unsigned)orig_taskType);
  dlgTaskManager::TaskViewRestore(wTaskView);
  RefreshView();
  return true;
}
Beispiel #28
0
void
TaskListPanel::ReClick()
{
  if (browse_tabbed->GetCurrentPage() == 0) // manage page
    dlgTaskManager::OnTaskViewClick(wTaskView, 0, 0);
  else {
    browse_tabbed->SetCurrentPage(0);
    dlgTaskManager::TaskViewRestore(wTaskView);
  }
  RefreshView();
}
Beispiel #29
0
void
TaskPropertiesPanel::OnFAIFinishHeightChange(DataFieldBoolean &df)
{
  OrderedTaskBehaviour &p = ordered_task->GetOrderedTaskBehaviour();
  bool newvalue = df.GetAsBoolean();
  if (newvalue != p.fai_finish) {
    p.fai_finish = newvalue;
    *task_changed = true;
    RefreshView();
  }
}
void
OptionStartsWidget::Remove(unsigned i)
{
  if (RealStartExists)
    --i;

  if (task.RemoveOptionalStart(i)) {
    RefreshView();
    modified = true;
  }
}