Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[419cd4]: src / hugin1 / ptbatcher / ProjectListBox.h Maximize Restore History

Download this file

ProjectListBox.h    102 lines (91 with data), 3.2 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
// -*- c-basic-offset: 4 -*-
/** @file ProjectListBox.h
*
* @brief Batch processor for Hugin with GUI
*
* @author Marko Kuder <marko.kuder@gmail.com>
*
* $Id: ProjectListBox.h 3322 2008-08-16 5:00:07Z mkuder $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <wx/listctrl.h>
#include <wx/xrc/xh_listc.h>
#include "ProjectArray.h"
#include "Batch.h"
class ProjectListBox : public wxListCtrl
{
public:
//Constructor
bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, const wxString& name = wxT("panel"));
//Appends project to list
void AppendProject(Project* project);
void ChangePrefix(int index, wxString newPrefix);
void Deselect(int index);
void Fill(Batch* batch);
int GetIndex(int id);
int GetProjectCountByPath(wxString path);
int GetProjectId(int index);
int GetSelectedIndex();
wxString GetSelectedProject();
/** gets the prefix of the currently selected project */
wxString GetSelectedProjectPrefix();
/** return the target of the currently selected project */
Project::Target GetSelectedProjectTarget();
wxString GetText(int row, int column);
void ReloadProject(int index, Project* project);
void Select(int index);
void SetMissing(int index);
void SwapProject(int index);
bool UpdateStatus(int index, Project* project);
private:
int m_selected;
Batch* m_batch;
IntArray columns;
wxString GetAttributeString(int i, Project* project);
wxString GetLongerFormatName(std::string str);
void OnColumnWidthChange(wxListEvent &event);
void OnDeselect(wxListEvent &event);
void OnSelect(wxListEvent &event);
enum ColumnName {
ID,
PROJECT,
PREFIX,
MODDATE,
FORMAT,
PROJECTION,
SIZE,
STATUS
};
//options taken from enum in PanoramaOptions.h. Should it change
//in the future, these arrays should be corrected also
static const wxString fileFormat[];
static const wxString outputMode[];
static const wxString HDRMergeType[];
static const wxString blendingMechanism[];
static const wxString colorCorrection[];
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(ProjectListBox)
};
/** xrc handler */
class ProjectListBoxXmlHandler : public wxListCtrlXmlHandler
{
DECLARE_DYNAMIC_CLASS(ProjectListBoxXmlHandler)
public:
ProjectListBoxXmlHandler();
virtual wxObject *DoCreateResource();
virtual bool CanHandle(wxXmlNode *node);
};