Implemented "Stop Loading" feature, designed icon, added button and necessary

wiring to arrive at BWebFrame::StopLoading().


git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@211 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
stippi
2010-02-25 12:30:39 +00:00
parent 16ccf622ab
commit 1da75c0bed
3 changed files with 31 additions and 3 deletions
+13
View File
@@ -288,3 +288,16 @@ resource(203) #'VICN' array {
$"000A06020607100117812004"
};
resource(204) #'VICN' array {
$"6E63696606050102000602393D323BB602BEA28F3C4CC64B601449439F00FF3E"
$"3EFFF70606020006033B27153C10C7BDF9893D088A4B2F634882C500C805057D"
$"9D0404FFB4040403750303020006023B06EB3B5469BC08EB3BB31F4AB15D4478"
$"7700FF9090FFFF757504FF440A0A0C2E4C364E3C4742524A5440434A3842353C"
$"BE1B36312E2E38400A0636313C3C40434A54504E402E0A03364E3E483C470A04"
$"483FC712BADE4A3840430A042E2E3631402E382C0A0442354A38C712BADE4AB9"
$"EC0A0E2E4C364EBEB6C37042524A54504E483FC712BADE4AB9EC4335402E382C"
$"2E2E384008022FB8A0BCC3B80708033C3C42364ABA120802BCA9BFF3B8D3C47B"
$"060A0001061001178400040A020101000A03020302000A010100000A04020504"
$"000A0503070809100117810004"
};
+17 -3
View File
@@ -64,6 +64,7 @@
enum {
GO_BACK = 'goba',
GO_FORWARD = 'gofo',
STOP = 'stop',
GOTO_URL = 'goul',
RELOAD = 'reld',
CLEAR_HISTORY = 'clhs',
@@ -137,7 +138,7 @@ LauncherWindow::LauncherWindow(BRect frame, const BMessenger& downloadListener,
m_goMenu = new BMenu("Go");
m_menuBar->AddItem(m_goMenu);
// Back & Forward
// Back, Forward & Stop
m_BackButton = new IconButton("Back", 0, NULL, new BMessage(GO_BACK));
m_BackButton->SetIcon(201);
m_BackButton->TrimIcon();
@@ -146,6 +147,10 @@ LauncherWindow::LauncherWindow(BRect frame, const BMessenger& downloadListener,
m_ForwardButton->SetIcon(202);
m_ForwardButton->TrimIcon();
m_StopButton = new IconButton("Stop", 0, NULL, new BMessage(STOP));
m_StopButton->SetIcon(204);
m_StopButton->TrimIcon();
// URL
m_url = new BTextControl("url", "", "", new BMessage(GOTO_URL));
m_url->SetDivider(50.0);
@@ -194,8 +199,9 @@ LauncherWindow::LauncherWindow(BRect frame, const BMessenger& downloadListener,
.Add(BGridLayoutBuilder(kElementSpacing, kElementSpacing)
.Add(m_BackButton, 0, 0)
.Add(m_ForwardButton, 1, 0)
.Add(m_url, 2, 0)
.Add(button, 3, 0)
.Add(m_StopButton, 2, 0)
.Add(m_url, 3, 0)
.Add(button, 4, 0)
.SetInsets(kInsetSpacing, kInsetSpacing, kInsetSpacing, kInsetSpacing)
)
// .Add(new BSeparatorView(B_HORIZONTAL, B_PLAIN_BORDER))
@@ -263,6 +269,9 @@ void LauncherWindow::MessageReceived(BMessage* message)
case GO_FORWARD:
CurrentWebView()->GoForward();
break;
case STOP:
CurrentWebView()->StopLoading();
break;
case CLEAR_HISTORY: {
BrowsingHistory* history = BrowsingHistory::defaultInstance();
@@ -507,6 +516,9 @@ void LauncherWindow::LoadFinished(const BString& url, BWebView* view)
StatusChanged(status, view);
if (m_loadingProgressBar && !m_loadingProgressBar->IsHidden())
m_loadingProgressBar->Hide();
NavigationCapabilitiesChanged(m_BackButton->IsEnabled(),
m_ForwardButton->IsEnabled(), false, view);
}
void LauncherWindow::ResizeRequested(float width, float height, BWebView* view)
@@ -581,6 +593,8 @@ void LauncherWindow::NavigationCapabilitiesChanged(bool canGoBackward,
m_BackButton->SetEnabled(canGoBackward);
if (m_ForwardButton)
m_ForwardButton->SetEnabled(canGoForward);
if (m_StopButton)
m_StopButton->SetEnabled(canStop);
}
void LauncherWindow::UpdateGlobalHistory(const BString& url)
+1
View File
@@ -99,6 +99,7 @@ private:
BMenu* m_goMenu;
IconButton* m_BackButton;
IconButton* m_ForwardButton;
IconButton* m_StopButton;
BTextControl* m_url;
BString m_loadedURL;
BStringView* m_statusText;