Hugin trunk 0.1
Loading...
Searching...
No Matches
ProgressStatusBar.cpp
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
2
11/*
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
16 *
17 * This software is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public
23 * License along with this software. If not, see
24 * <http://www.gnu.org/licenses/>.
25 *
26 */
27
28#include "ProgressStatusBar.h"
29
30ProgressStatusBar::ProgressStatusBar(wxWindow *parent, wxWindowID id, long style, const wxString &name) : wxStatusBar(parent, id, style, name)
31{
33 SetProgress(-1);
35}
36
38{
39 if (m_progress)
40 {
41 delete m_progress;
42 };
43}
44
46{
47 if (GetFieldsCount() > 0)
48 {
49 wxRect r;
51 r.Deflate(2, 2);
52 m_progress->SetSize(r);
53 };
54 event.Skip();
55}
56
58{
60 m_progress->Show(m_progressValue >= 0);
61 // SetValue expects values >=0 and < max value, but we are using -1 to indicate that progress bar is hidden
62 m_progress->SetValue(m_progressValue < 0 ? 0 : m_progressValue);
63};
64
definition of statusbar with progress indicator
~ProgressStatusBar()
destructor, clean up all stuff
void OnSize(wxSizeEvent &event)
size change handler, correctly position gauge when size has changed
int GetProgress()
return current progress value, should be in range 0 - 100, or -1 if the progress gauge is hidden
void SetProgress(int progress)
update progress bar
ProgressStatusBar(wxWindow *parent, wxWindowID id, long style=wxST_SIZEGRIP, const wxString &name="statusBar")
constructor, create the gauge internal
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41