// Splitting
int hsize = size.GetHeight();
- int bottom_minsize = 40;
+ int top_minsize = 500;
+ int bottom_minsize = 50;
mSplitter->SetMinimumPaneSize( bottom_minsize );
mSplitter->SplitHorizontally( mNotebook, mBottomPanel,
- hsize - bottom_minsize);
-
+ top_minsize);
+
sizer->Add( mSplitter,1,wxGROW ,0);
mViewer->SetImage(0,GetDefaultImage());
first_time = false;
}
- // mViewer->Refresh();
+ // GimmickMessage(1,"WxGimmickView : Refresh viewer"<<std::endl);
+
+ if (mViewer->RefreshIfNecessary())
+ {
+ // mViewer->Refresh();
+ // mViewer->SetFocus();
+ }
}
//=================================================
GimmickDebugMessage(1,"WxViewer::WxViewer"
<<std::endl);
+ mNeedRefresh = false;
+ mLastImageShown = NULL;
+
wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
void WxViewer::ShowNextImage()
{
wxMutexLocker lock(mMutex);
+ /*
GimmickMessage(1,"WxViewer::ShowNextImage() "
<<mCurrent+1<<"/"
<<images.size()<<std::endl);
+ */
+
if (mCurrent<images.size())
{
ShowImage(images[mCurrent]);
+ if ( images[mCurrent] != mLastImageShown ) mNeedRefresh = true;
+ mLastImageShown = images[mCurrent];
}
mCurrent++;
if (mCurrent >= images.size()) mCurrent = 0;
}
//================================================================
-
+ bool WxViewer::RefreshIfNecessary()
+ {
+ if (mNeedRefresh)
+ {
+ GimmickMessage(1,"WxViewer : Refreshing"<<std::endl);
+ mInteractor->Render();
+ // mViewer->Render();
+ // Refresh();
+ mNeedRefresh = false;
+ return true;
+ }
+ return false;
+ }
//==================================================
void WxViewer::StopPlayer()
{
if(!TestDestroy())
{
mWxViewer->ShowNextImage();
- mWxViewer->Refresh();
+ // mWxViewer->Refresh();
+ ::wxWakeUpIdle();
clock_t endwait;
endwait = clock () + 0.2 * CLOCKS_PER_SEC ;
while (clock() < endwait) {}