From fe380306fdb55024769d738f426a63e4734032d0 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Fri, 17 Jun 2011 10:28:46 +1000 Subject: [PATCH] RefreshData -> DoRefreshData event fix --- Projects/CodeBlocks/SleepyHead.depend | 6 +++--- src/SleepyHeadMain.cpp | 8 ++++---- src/graphs/graph.cpp | 25 +++++++++++++++++++++---- src/version.h | 12 ++++++------ 4 files changed, 34 insertions(+), 17 deletions(-) diff --git a/Projects/CodeBlocks/SleepyHead.depend b/Projects/CodeBlocks/SleepyHead.depend index 2e2e9b3e..5c939fda 100644 --- a/Projects/CodeBlocks/SleepyHead.depend +++ b/Projects/CodeBlocks/SleepyHead.depend @@ -8309,7 +8309,7 @@ 1308026543 D -1308260097 /home/mark/projects/git/sleepyhead/src/version.h +1308265378 /home/mark/projects/git/sleepyhead/src/version.h 1308003040 ent of cb2ab33... Linux wx2.8 & wx2.9 builds fixed @@ -8341,7 +8341,7 @@ "preferences.h" "tinyxml/tinyxml.h" -1308259685 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadMain.cpp +1308264665 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadMain.cpp "wx_pch.h" "version.h" @@ -8362,7 +8362,7 @@ "sleeplib/profiles.h" "sleeplib/machine_loader.h" -1308259082 source:/home/mark/projects/git/sleepyhead/src/graphs/graph.cpp +1308265075 source:/home/mark/projects/git/sleepyhead/src/graphs/graph.cpp "freetype-gl/font-manager.h" "freetype-gl/texture-font.h" "graph.h" diff --git a/src/SleepyHeadMain.cpp b/src/SleepyHeadMain.cpp index 422871ff..aae20847 100644 --- a/src/SleepyHeadMain.cpp +++ b/src/SleepyHeadMain.cpp @@ -353,7 +353,7 @@ void SleepyHeadFrame::OnViewMenuDaily( wxCommandEvent& event ) } else { main_auinotebook->SetSelection(idx); - daily->Refresh(true); + daily->Refresh(); } @@ -711,7 +711,7 @@ Daily::Daily(wxWindow *win,Profile *p) SF->AddLayer(new gFlagsLine(flags[3],wxBLUE,wxT("H"),3,sfc)); SF->AddLayer(new gFlagsLine(flags[2],wxAQUA,wxT("OA"),2,sfc)); SF->AddLayer(new gFlagsLine(flags[1],wxPURPLE,wxT("CA"),1,sfc)); - SF->AddLayer(new gFlagsLine(flags[0],wxGREEN2,wxT("CSR"),0,sfc)); + SF->AddLayer(new gFlagsLine(flags[0],wxGREEN,wxT("CSR"),0,sfc)); SF->AddLayer(new gFooBar(wxGREEN,wxDARK_GREY,true)); @@ -832,7 +832,7 @@ Daily::Daily(wxWindow *win,Profile *p) //fgSizer->Add(TAP_EAP,1,wxEXPAND); this->Connect(wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler(Daily::OnEventTreeSelection), NULL, this); - this->Connect(wxID_ANY, wxEVT_REFRESH_DAILY, wxCommandEventHandler(Daily::RefreshData)); + this->Connect(wxID_ANY, wxEVT_REFRESH_DAILY, wxCommandEventHandler(Daily::DoRefreshData)); //this->Connect(wxEVT_SCROLLWIN_THUMBTRACK @@ -919,7 +919,7 @@ void Daily::RefreshData() wxCommandEvent MyEvent( wxEVT_REFRESH_DAILY); wxPostEvent(this, MyEvent); } -void Daily::RefreshData(wxCommandEvent& event) +void Daily::DoRefreshData(wxCommandEvent& event) { wxDateTime date=Calendar->GetDate(); date.ResetTime(); diff --git a/src/graphs/graph.cpp b/src/graphs/graph.cpp index 01cda879..7faabff9 100644 --- a/src/graphs/graph.cpp +++ b/src/graphs/graph.cpp @@ -56,13 +56,14 @@ wxColor *wxDARK_GREEN=&zwxDARK_GREEN; wxColor zwxDARK_GREY(0xA0,0xA0,0xA0,0xA0); wxColor *wxDARK_GREY=&zwxDARK_GREY; -bool gfont_init=false; FontManager *font_manager; TextureFont *bigfont=NULL,*zfont=NULL; VertexBuffer *vbuffer=NULL; TextMarkup *markup=NULL; +static bool gfont_init=false; + // Must be called from a thread inside the application. void GraphInit() { @@ -373,7 +374,7 @@ gGraphWindow::gGraphWindow(wxWindow *parent, wxWindowID id,const wxString & titl m_scrX = m_scrY = 64; m_title=title; m_mouseRDown=m_mouseLDown=false; - SetBackgroundColour( *wxWHITE ); + //SetBackgroundColour( *wxWHITE ); m_bgColour = *wxWHITE; m_fgColour = *wxBLACK; SetMargins(5, 15, 0, 0); @@ -415,7 +416,7 @@ gGraphWindow::gGraphWindow(wxWindow *parent, wxWindowID id,const wxString & titl if (!title.IsEmpty()) { AddLayer(new gGraphTitle(title,wxVERTICAL)); } - SetBackgroundStyle(wxBG_STYLE_CUSTOM); + //SetBackgroundStyle(wxBG_STYLE_CUSTOM); } gGraphWindow::~gGraphWindow() @@ -1114,7 +1115,7 @@ void gGraphWindow::OnPaint(wxPaintEvent& event) GetClientSize(&m_scrX, &m_scrY); - Render(m_scrX,m_scrY); + // Render(m_scrX,m_scrY); if (m_mouseLDown) { if (m_mouseRBrect.width>0) @@ -2542,6 +2543,17 @@ void gFlagsLine::Plot(gGraphWindow & w,float scrx,float scry) glColor4ub(col.Red(),col.Green(),col.Blue(),col.Alpha()); glScissor(w.GetLeftMargin(),w.GetBottomMargin(),width,height); glEnable(GL_SCISSOR_TEST); + + glLineWidth (1); + bool antialias=pref["UseAntiAliasing"]; + if (antialias) { + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); //_MINUS_SRC_ALPHA); + glEnable(GL_LINE_SMOOTH); + glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); + + } + if (quadcnt>0) { glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(2, GL_SHORT, 0, quadarray); @@ -2554,6 +2566,11 @@ void gFlagsLine::Plot(gGraphWindow & w,float scrx,float scry) glDrawArrays(GL_LINES, 0, vertcnt>>1); glDisableClientState(GL_VERTEX_ARRAY); } + if (antialias) { + glDisable(GL_LINE_SMOOTH); + glDisable(GL_BLEND); + } + glDisable(GL_SCISSOR_TEST); } diff --git a/src/version.h b/src/version.h index c2ee6f9f..cff1fd21 100644 --- a/src/version.h +++ b/src/version.h @@ -16,14 +16,14 @@ namespace AutoVersion{ //Standard Version Type static const long _MAJOR = 0; static const long _MINOR = 7; - static const long _BUILD = 6458; - static const long _REVISION = 18537; + static const long _BUILD = 6464; + static const long _REVISION = 18572; //Miscellaneous Version Types - static const long _BUILDS_COUNT = 7602; - #define _RC_FILEVERSION 0,7,6458,18537 - #define _RC_FILEVERSION_STRING "0, 7, 6458, 18537\0" - static const char _FULLVERSION_STRING[] = "0.7.6458.18537"; + static const long _BUILDS_COUNT = 7622; + #define _RC_FILEVERSION 0,7,6464,18572 + #define _RC_FILEVERSION_STRING "0, 7, 6464, 18572\0" + static const char _FULLVERSION_STRING[] = "0.7.6464.18572"; //These values are to keep track of your versioning state, don't modify them. static const long _BUILD_HISTORY = 0;