BREW Tab Browser by SophiaFramework UNIVERSE
Preface
This page outlines the programming procedure to build a Tab Browser for BREW enabled mobile phones using SophiaFramework UNIVERSE.
* Source code for Tab Browser can be downloaded with the free trial of SophiaFramework UNIVERSE. (SophiaFramework UNIVERSE is available only in Japanese)
Tab Browser
Tab Browser is a sample application for SophiaFramework UNIVERSE.
![]() |
It uses the following SophiaFramework UNIVERSE Standard Control Classes. |
|---|
Restrictions on Tab Browser
- The SFRBrowserControl class used in Tab Browser employs the IHtmlViewer, the standard BREW interface to handle HTML documents. IHtmlViewer has some restrictions for image formats, file paths and text encoding (only for Shift-JIS).
- Pressing the "1 key" enables the "page menu" to be displayed when selecting a hyperlink. Pressing the "2 key" desables the "page menu".
- The "favorites" page can not be edited. To clear the favorites page, delete the "favorite.dat" file using the BREW AppLoader.
- IHtmlViewer also does not support redirection, so links that have been moved must be clicked manually.
Using the Tab Browser
|
The following keys are used to operate Tab Browser.
When using Tab Browser for the first time, the favorites section should contain a "*URL Input*" item and an "example page" item. Choose "*URL Input*" to input a URL, or choose "example page" to go to a demonstration page by Sophia Cradle. Pressing the Select key while a hyperlink is highlighted jumps to the linked page. If the "1 key" is pressed, selecting a hyperlink generates the "page menu". The "page menu" can be disabled by pressing the "2 key".
|
Name and Function of Browser Window Controls

-
- Reload :
Reloads the displayed page
( SFRButtonControl ) - Close:
Closes the displayed page
( SFRButtonControl ) - Favorites menu:
Displays favorites page
( SFRComboboxControl ) - Set options:
Displays the options page
( SFRButtonControl ) - Browser tab:
Shows browser tab
( SFRTabControl )
- Reload :
Reloads the displayed page
Tab Browser development process
* Click image, then click the bottom left icon in the window for an enlarged image
Tab Browser Sample Code
Tab Browser Sample Code 1
//
// When select key is pressed in tab control
//
HANDLER_IMPLEMENT_VOIDVOID(BrowserWindow, TabHandler)
{
BrowserPanePtr pane;
// Get the foremost browser pane
pane = static_cast<BrowserPanePtr>(_tab->GetFront());
// if successful
if (pane != null) {
// move focus to that browser pane
pane->SetFocusTarget(true);
}
return;
}
Tab Browser Sample Code 2
//
// When Soft key 1 or 2 is pressed
//
HANDLER_IMPLEMENT_VOIDEVENT(BrowserWindow, SoftKeyHandler, event)
{
BrowserPanePtr pane;
// Get the foremost front browser pane
pane = static_cast<BrowserPanePtr>(_tab->GetFront());
// If successful
if (pane != null) {
// Release focus from that browser pane
pane->SetFocusTarget(false);
// Switch, according to key code
switch (event.GetP16()) {
case AVK_SOFT1:
// Get the next browser pane on the left
pane = static_cast<BrowserPanePtr>(pane->GetLeft());
break;
case AVK_SOFT2:
// Get the next browser pane on the right
pane = static_cast<BrowserPanePtr>(pane->GetRight());
break;
default:
break;
}
// When there is a new browser pane
if (pane != null) {
// Select next browser pane
pane->Select();
}
}
// Set focus to tab control
_tab->SetStatusFocus(true);
return;
}
Tab Browser Sample Code 3
// Constant that stands for pictograms
#define ICONWORD_CHECKEREDFLAG 0x92F6 // Checker flag
#define ICONWORD_CHECKMARK 0x73F7 // Check mark
#define ICONWORD_CAUTIONMARK 0x59F6 // Warning symbol
//
// Constructor
// Invoke parent class constructor and initialize
//
BrowserPane::BrowserPane
(SFRTabControlPtr control,
SFXWideStringConstRef title, SFXWideStringConstRef url)
: SFRTabPane(control, "")
{
// If no error in the parent class
if (static_try()) {
// Generate browser control
_browser = ::new BrowserControl(this, GetVirtualWorld());
// Register left/right arrow keys to handler
_browser->RegisterHandler
(SFEVT_KEY, AVK_RIGHT, HANDLER_AFTER,
HANDLER_FUNCTION(NextHandler));
_browser->RegisterHandler
(SFEVT_KEY, AVK_LEFT, HANDLER_AFTER,
HANDLER_FUNCTION(PreviousHandler));
// Display scroll bar of browser control
_browser->SetScrollbarEnable(true);
// Invoke URL open function
Open(title, url);
}
return;
}
Tab Browser Sample Code 4
//
// Destructor
// Does nothing
//
BrowserPane::~BrowserPane(Void)
{
return;
}
Tab Browser Screen Shots
Tab Browser Screen Shot 1 : SFRComboboxControl
Tab Browser Screen Shot 2 : OptionPane












