On Fri, 2009-05-08 at 02:13 +0100, James Legg wrote:
> Also with large projects, it is very unlikely that you can't see all the
> identified images' buttons highlighted. Before they would be mostly
> hidden, as the buttons had a scrollable box where only a few were
> visible.
Hmmm... I've just found out the scrollable region here doesn't get
smaller. You can scroll the buttons to the right and the highlighted
buttons all shift off the screen to the left, so you are left with no
buttons visible at all.
It doesn't shrink when you start a new project and add a single image
either, even though the image button now fits on the screen without a
scrollbar.
This updated patch will scroll to the start of the buttons when needed
for the identify tool.
We should really set both previews' m_ButtonPanel correctly when images
are removed instead.
James
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group.
A list of frequently asked questions is available at:
http://wiki.panotools.org/Hugin_FAQTo post to this group, send email to
hugin-ptx@...
To unsubscribe from this group, send email to
hugin-ptx-unsubscribe@...
For more options, visit this group at
http://groups.google.com/group/hugin-ptx-~----------~----~----~----~------~----~------~--~---
Index: src/hugin1/hugin/PreviewIdentifyTool.cpp
===================================================================
--- src/hugin1/hugin/PreviewIdentifyTool.cpp (revision 3836)
+++ src/hugin1/hugin/PreviewIdentifyTool.cpp (working copy)
@@ -204,6 +204,11 @@
}
}
}
+ if (new_image_set.size() == 0)
+ {
+ // unhide the image buttons in the preview when no images highlighted.
+ preview_frame->CleanButtonColours();
+ }
// now request to be notified when drawing the new ones.
{
std::vector<unsigned int> difference(new_image_set.size());
Index: src/hugin1/hugin/GLPreviewFrame.h
===================================================================
--- src/hugin1/hugin/GLPreviewFrame.h (revision 3836)
+++ src/hugin1/hugin/GLPreviewFrame.h (working copy)
@@ -38,6 +38,7 @@
class wxSpinEvent;
class wxChoice;
+class GLPreviewFrame;
class PreviewToolHelper;
class PreviewTool;
class PreviewCropTool;
@@ -59,7 +60,8 @@
PreviewIdentifyTool **identify_tool,
unsigned int identify_tool_id,
wxToolBar *tool_bar,
- PT::Panorama * m_pano);
+ PT::Panorama * m_pano,
+ GLPreviewFrame *preview_frame);
void OnChange(wxCommandEvent &e);
protected:
void OnEnter(wxMouseEvent & e);
@@ -70,6 +72,7 @@
PreviewIdentifyTool **identify_tool;
unsigned int identify_tool_id;
wxToolBar *tool_bar;
+ GLPreviewFrame *preview_frame;
PT::Panorama * m_pano;
};
@@ -82,6 +85,7 @@
*/
class GLPreviewFrame : public wxFrame, public PT::PanoramaObserver, public utils::MultiProgressDisplay
{
+ friend class ImageToogleButtonEventHandler;
public:
/** ctor.
@@ -101,6 +105,7 @@
void SetImageButtonColour(unsigned int image_nr, unsigned char red,
unsigned char green, unsigned char blue);
void SetStatusMessage(wxString message);
+ void CleanButtonColours();
protected:
void OnClose(wxCloseEvent& e);
@@ -174,8 +179,10 @@
PreviewIdentifyTool *identify_tool;
PreviewDifferenceTool *difference_tool;
PreviewPanoMaskTool *pano_mask_tool;
+
+ bool hiding_image_buttons;
+ bool identify_number_to_position;
void TurnOffTools(std::set<PreviewTool*> tools);
- void CleanButtonColours();
};
Index: src/hugin1/hugin/GLPreviewFrame.cpp
===================================================================
--- src/hugin1/hugin/GLPreviewFrame.cpp (revision 3836)
+++ src/hugin1/hugin/GLPreviewFrame.cpp (working copy)
@@ -398,6 +398,10 @@
SetIcon(myIcon);
m_pano.addObserver(this);
+
+ // don't hide image buttons at the start.
+ hiding_image_buttons = false;
+ identify_number_to_position = false;
RestoreFramePosition(this, wxT("GLPreviewFrame"));
@@ -571,7 +575,7 @@
ImageToogleButtonEventHandler * event_handler = new
ImageToogleButtonEventHandler(*it, &identify_tool,
identify_tool_id, m_ToolBar,
- &m_pano);
+ &m_pano, this);
toogle_button_event_handlers.push_back(event_handler);
but->PushEventHandler(event_handler);
wxSize sz = but->GetSize();
@@ -1103,28 +1107,47 @@
wxColour(red, green, blue));
// black should be visible on the button's vibrant colours.
m_ToggleButtons[image_nr]->SetForegroundColour(wxColour(0, 0, 0));
+ if (!(hiding_image_buttons || identify_number_to_position))
+ {
+ // hide image buttons when identifing image numbers from position.
+ hiding_image_buttons = true;
+ unsigned int nr_images = m_pano.getNrOfImages();
+ for (unsigned image = 0; image < nr_images; image++)
+ {
+ m_ToggleButtons[image]->Show(false);
+ }
+ }
+ m_ToggleButtons[image_nr]->Show(true);
} else {
- // return to the normal colour
+ // return to the normal colour and show.
m_ToggleButtons[image_nr]->SetBackgroundStyle(wxBG_STYLE_SYSTEM);
m_ToggleButtons[image_nr]->SetBackgroundColour(wxNullColour);
m_ToggleButtons[image_nr]->SetForegroundColour(wxNullColour);
- }
- m_ToggleButtons[image_nr]->Refresh();
+ // hide again?
+ if (hiding_image_buttons)
+ {
+ m_ToggleButtons[image_nr]->Show(false);
+ }
+ }
+ m_ButtonSizer->SetVirtualSizeHints(m_ButtonPanel);
+ if (hiding_image_buttons) m_ButtonPanel->Scroll(0,0);
}
void GLPreviewFrame::CleanButtonColours()
{
// when we turn off the identification tool, any buttons that were coloured
// to match the image in the preview should be given back the system themed
- // colours.
+ // colours, and unhidden.
unsigned int nr_images = m_pano.getNrOfImages();
for (unsigned image = 0; image < nr_images; image++)
{
m_ToggleButtons[image]->SetBackgroundStyle(wxBG_STYLE_SYSTEM);
m_ToggleButtons[image]->SetBackgroundColour(wxNullColour);
m_ToggleButtons[image]->SetForegroundColour(wxNullColour);
- m_ToggleButtons[image]->Refresh();
+ m_ToggleButtons[image]->Show(true);
}
+ m_ButtonSizer->SetVirtualSizeHints(m_ButtonPanel);
+ hiding_image_buttons = false;
}
ImageToogleButtonEventHandler::ImageToogleButtonEventHandler(
@@ -1132,13 +1155,15 @@
PreviewIdentifyTool **identify_tool_in,
unsigned int identify_tool_id_in,
wxToolBar *tool_bar_in,
- PT::Panorama * m_pano_in)
+ PT::Panorama * m_pano_in,
+ GLPreviewFrame * preview_frame_in)
{
image_number = image_number_in;
identify_tool = identify_tool_in;
identify_tool_id = identify_tool_id_in;
tool_bar = tool_bar_in;
m_pano = m_pano_in;
+ preview_frame = preview_frame_in;
}
void ImageToogleButtonEventHandler::OnEnter(wxMouseEvent & e)
@@ -1149,6 +1174,7 @@
if ( tool_bar->GetToolState(identify_tool_id)
&& m_pano->getActiveImages().count(image_number))
{
+ preview_frame->identify_number_to_position = true;
(*identify_tool)->ShowImageNumber(image_number);
}
e.Skip();
@@ -1162,6 +1188,7 @@
&& m_pano->getActiveImages().count(image_number))
{
(*identify_tool)->StopShowingImages();
+ preview_frame->identify_number_to_position = false;
}
e.Skip();
}