|
From: CVS C. to T. <the...@li...> - 2011-06-05 13:37:28
|
Revision: 657
http://themis.svn.sourceforge.net/themis/?rev=657&view=rev
Author: mark_hellegers
Date: 2011-06-05 13:37:21 +0000 (Sun, 05 Jun 2011)
Log Message:
-----------
Moved urlview of ThemisNavView to private and fixed code that depended on it being public.
Modified Paths:
--------------
trunk/themis/framework/ThemisNavView.cpp
trunk/themis/framework/ThemisNavView.h
trunk/themis/framework/ThemisTabView.cpp
trunk/themis/framework/ThemisUrlPopUpWindow.cpp
trunk/themis/framework/win.cpp
Modified: trunk/themis/framework/ThemisNavView.cpp
===================================================================
--- trunk/themis/framework/ThemisNavView.cpp 2011-06-05 13:05:17 UTC (rev 656)
+++ trunk/themis/framework/ThemisNavView.cpp 2011-06-05 13:37:21 UTC (rev 657)
@@ -243,3 +243,34 @@
buttons[aButton]->SetMode(aMode, aForceMode);
}
+
+const char * ThemisNavView :: GetUrl() const {
+
+ return urlview->Text();
+
+}
+
+void ThemisNavView :: SetFocusOnUrlView() {
+
+ urlview->TextView()->MakeFocus(true);
+
+}
+
+BRect ThemisNavView :: GetFrameOfUrlView() const {
+
+ return urlview->Frame();
+
+}
+
+BRect ThemisNavView :: GetBoundsOfUrlView() const {
+
+ return urlview->Bounds();
+
+}
+
+void ThemisNavView :: SetUrl(const char * aUrl, BBitmap * aFavIcon) {
+
+ urlview->SetText(aUrl);
+ urlview->SetFavIcon(aFavIcon);
+
+}
Modified: trunk/themis/framework/ThemisNavView.h
===================================================================
--- trunk/themis/framework/ThemisNavView.h 2011-06-05 13:05:17 UTC (rev 656)
+++ trunk/themis/framework/ThemisNavView.h 2011-06-05 13:37:21 UTC (rev 657)
@@ -14,6 +14,7 @@
private:
TPictureButton * buttons[7];
+ ThemisUrlView * urlview;
public:
ThemisNavView(BRect rect);
@@ -23,8 +24,12 @@
void MouseDown(BPoint point);
void CreateInterfaceButtons();
void SetButtonMode(int aButton, int8 aMode, bool aForceMode = false);
+ const char * GetUrl() const;
+ void SetFocusOnUrlView();
+ BRect GetFrameOfUrlView() const;
+ BRect GetBoundsOfUrlView() const;
+ void SetUrl(const char * aUrl, BBitmap * aFavIcon = NULL);
- ThemisUrlView * urlview;
};
#endif
Modified: trunk/themis/framework/ThemisTabView.cpp
===================================================================
--- trunk/themis/framework/ThemisTabView.cpp 2011-06-05 13:05:17 UTC (rev 656)
+++ trunk/themis/framework/ThemisTabView.cpp 2011-06-05 13:37:21 UTC (rev 657)
@@ -291,7 +291,7 @@
{
if( Window()->CurrentFocus() != NULL )
Window()->CurrentFocus()->MakeFocus( false );
- ( ( Win* )Window() )->GetNavView()->urlview->TextView()->MakeFocus( true );
+ ( ( Win* )Window() )->GetNavView()->SetFocusOnUrlView();
}
break;
}
@@ -450,8 +450,7 @@
win->SetTitle( wtitle.String() );
tab->SetLabel( ttitle.String() );
- win->GetNavView()->urlview->SetText( url.String() );
- win->GetNavView()->urlview->SetFavIcon( tab->GetFavIcon() );
+ win->GetNavView()->SetUrl(url.String(), tab->GetFavIcon());
win->SetLoadingInfo(lprog, stext.String());
}
Modified: trunk/themis/framework/ThemisUrlPopUpWindow.cpp
===================================================================
--- trunk/themis/framework/ThemisUrlPopUpWindow.cpp 2011-06-05 13:05:17 UTC (rev 656)
+++ trunk/themis/framework/ThemisUrlPopUpWindow.cpp 2011-06-05 13:37:21 UTC (rev 657)
@@ -64,7 +64,7 @@
if (item) {
parentwindow->Lock();
- ((Win *)parentwindow)->GetNavView()->urlview->SetText(item->Text());
+ ((Win *)parentwindow)->GetNavView()->SetUrl(item->Text());
parentwindow->Unlock();
}
@@ -157,7 +157,7 @@
float difference = parent_bottom_cts.y - new_popup_bottom_cts.y - 20;
- float urlview_width = ((Win*)parentwindow)->GetNavView()->urlview->Bounds().right;
+ float urlview_width = ((Win*)parentwindow)->GetNavView()->GetBoundsOfUrlView().right;
if( difference < 0 )
{
Modified: trunk/themis/framework/win.cpp
===================================================================
--- trunk/themis/framework/win.cpp 2011-06-05 13:05:17 UTC (rev 656)
+++ trunk/themis/framework/win.cpp 2011-06-05 13:37:21 UTC (rev 657)
@@ -149,7 +149,7 @@
// make the urlview the focusview for fast pasting :D
if (CurrentFocus() != NULL)
CurrentFocus()->MakeFocus(false);
- navview->urlview->TextView()->MakeFocus(true);
+ navview->SetFocusOnUrlView();
}
@@ -348,7 +348,7 @@
if (msg->HasString("url_to_open"))
url = msg->FindString("url_to_open");
else
- url = navview->urlview->Text();
+ url = navview->GetUrl();
// stop, if there is no url, or about:blank
if ((url.Length() == 0) || (strcmp(url.String(), kAboutBlankPage) == 0))
@@ -477,7 +477,7 @@
BWindow::FrameMoved(origin);
if (urlpopupwindow != NULL) {
- BPoint point(navview->ConvertToScreen(navview->urlview->Frame().LeftBottom()));
+ BPoint point(navview->ConvertToScreen(navview->GetFrameOfUrlView().LeftBottom()));
urlpopupwindow->MoveTo(point);
}
@@ -660,7 +660,7 @@
void Win :: CreateUrlPopUpWindow(BList * aList) {
if (urlpopupwindow == NULL) {
- BRect frame(navview->urlview->Frame());
+ BRect frame(navview->GetFrameOfUrlView());
frame = navview->ConvertToScreen(frame);
BRect wframe(frame);
@@ -675,7 +675,7 @@
// the urlpopup wouldnt be navigable by keyb
if (CurrentFocus() != NULL)
CurrentFocus()->MakeFocus(false);
- navview->urlview->textview->MakeFocus(true);
+ navview->SetFocusOnUrlView();
}
else {
urlpopupwindow->Lock();
@@ -834,7 +834,7 @@
if (show_all == true)
typed_url.SetTo("");
else {
- typed_url.SetTo(navview->urlview->Text());
+ typed_url.SetTo(navview->GetUrl());
typed_url.ToLower();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|