diff --git a/src/tests/kits/interface/menu/menuworld/BitmapMenuItem.cpp b/src/tests/kits/interface/menu/menuworld/BitmapMenuItem.cpp new file mode 100644 index 0000000000..a7ff4db33e --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/BitmapMenuItem.cpp @@ -0,0 +1,79 @@ +//-------------------------------------------------------------------- +// +// BitmapMenuItem.cpp +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#include "BitmapMenuItem.h" +#include "constants.h" + +//==================================================================== +// BitmapMenuItem Implementation + + + +//-------------------------------------------------------------------- +// BitmapMenuItem constructors, destructors, operators + +BitmapMenuItem::BitmapMenuItem(const char* name, const BBitmap& bitmap, + BMessage* message, char shortcut, uint32 modifiers) + : BMenuItem(name, message, shortcut, modifiers), + m_bitmap(bitmap.Bounds(), bitmap.ColorSpace()) +{ + // Sadly, operator= for bitmaps is not yet implemented. + // Half of m_bitmap's initialization is above; now we copy + // the bits. + m_bitmap.SetBits(bitmap.Bits(), bitmap.BitsLength(), + 0, bitmap.ColorSpace()); +} + + + +//-------------------------------------------------------------------- +// BitmapMenuItem constructors, destructors, operators + +void BitmapMenuItem::Draw(void) +{ + BMenu* menu = Menu(); + if (menu) { + BRect itemFrame = Frame(); + BRect bitmapFrame = itemFrame; + bitmapFrame.InsetBy(2, 2); // account for 2-pixel margin + + menu->SetDrawingMode(B_OP_COPY); + menu->SetHighColor(BKG_GREY); + menu->FillRect(itemFrame); + menu->DrawBitmap(&m_bitmap, bitmapFrame); + + if (IsSelected()) { + // a nonstandard but simple way to draw highlights + menu->SetDrawingMode(B_OP_INVERT); + menu->SetHighColor(0,0,0); + menu->FillRect(itemFrame); + } + } +} + +void BitmapMenuItem::GetContentSize(float* width, float* height) +{ + GetBitmapSize(width, height); +} + + + +//-------------------------------------------------------------------- +// BitmapMenuItem accessors + +void BitmapMenuItem::GetBitmapSize(float* width, float* height) +{ + BRect r = m_bitmap.Bounds(); + *width = r.Width() + 4; // 2-pixel boundary on either side + *height = r.Height() + 4; // 2-pixel boundary on top/bottom +} diff --git a/src/tests/kits/interface/menu/menuworld/BitmapMenuItem.h b/src/tests/kits/interface/menu/menuworld/BitmapMenuItem.h new file mode 100644 index 0000000000..c5c79b3d49 --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/BitmapMenuItem.h @@ -0,0 +1,54 @@ +//-------------------------------------------------------------------- +// +// BitmapMenuItem.h +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#ifndef _BitmapMenuItem_h +#define _BitmapMenuItem_h + +#include +#include + +//==================================================================== +// CLASS: BitmapMenuItem + +class BitmapMenuItem : public BMenuItem +{ + //---------------------------------------------------------------- + // Constructors, destructors, operators + +public: + BitmapMenuItem(const char* name, const BBitmap& bitmap, + BMessage* message, char shortcut = 0, + uint32 modifiers = 0); + + + //---------------------------------------------------------------- + // Virtual member function overrides + +protected: + void Draw(void); + void GetContentSize(float* width, float* height); + + //---------------------------------------------------------------- + // Accessors + +public: + void GetBitmapSize(float* width, float* height); + + //---------------------------------------------------------------- + // Member variables + +private: + BBitmap m_bitmap; +}; + +#endif /* _BitmapMenuItem_h */ \ No newline at end of file diff --git a/src/tests/kits/interface/menu/menuworld/Jamfile b/src/tests/kits/interface/menu/menuworld/Jamfile new file mode 100644 index 0000000000..9725dd7f8c --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/Jamfile @@ -0,0 +1,15 @@ +SubDir HAIKU_TOP src tests kits interface menu menuworld ; + +Application MenuWorld : + BitmapMenuItem.cpp + constants.cpp + main.cpp + MenuApp.cpp + MenuView.cpp + MenuWindow.cpp + PostDispatchInvoker.cpp + stddlg.cpp + TestMenuBuilder.cpp + ViewLayoutFactory.cpp + : be $(TARGET_LIBSUPC++) + ; diff --git a/src/tests/kits/interface/menu/menuworld/LICENSE b/src/tests/kits/interface/menu/menuworld/LICENSE new file mode 100644 index 0000000000..86a4268fa9 --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/LICENSE @@ -0,0 +1,31 @@ +---------------------- +Be Sample Code License +---------------------- + +Copyright 1991-1999, Be Incorporated. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions, and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions, and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/tests/kits/interface/menu/menuworld/MenuApp.cpp b/src/tests/kits/interface/menu/menuworld/MenuApp.cpp new file mode 100644 index 0000000000..a7e8b025f7 --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/MenuApp.cpp @@ -0,0 +1,50 @@ +//-------------------------------------------------------------------- +// +// MenuApp.cpp +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#include + +#include "constants.h" +#include "MenuApp.h" +#include "MenuWindow.h" + +//==================================================================== +// MenuApp Implementation + + + +//-------------------------------------------------------------------- +// MenuApp constructors, destructors, operators + +MenuApp::MenuApp() + : BApplication(STR_APP_SIG) +{ + // empty +} + + + +//-------------------------------------------------------------------- +// MenuApp virtual function overrides + +void MenuApp::AboutRequested(void) +{ + BAlert* aboutBox = new BAlert(STR_ABOUT_TITLE, + STR_ABOUT_DESC, STR_ABOUT_BUTTON); + aboutBox->Go(); +} + +void MenuApp::ReadyToRun(void) +{ + MenuWindow* pWin = new MenuWindow(STR_APP_NAME); + pWin->Show(); +} diff --git a/src/tests/kits/interface/menu/menuworld/MenuApp.h b/src/tests/kits/interface/menu/menuworld/MenuApp.h new file mode 100644 index 0000000000..137ce8be7e --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/MenuApp.h @@ -0,0 +1,39 @@ +//-------------------------------------------------------------------- +// +// MenuApp.h +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#ifndef _MenuApp_h +#define _MenuApp_h + +#include + +//==================================================================== +// CLASS: MenuApp + +class MenuApp : public BApplication +{ + //---------------------------------------------------------------- + // Constructors, destructors, operators + +public: + MenuApp(); + + //---------------------------------------------------------------- + // Virtual function overrides + +public: + void AboutRequested(void); + void ReadyToRun(void); + +}; + +#endif /* _MenuApp_h */ \ No newline at end of file diff --git a/src/tests/kits/interface/menu/menuworld/MenuView.cpp b/src/tests/kits/interface/menu/menuworld/MenuView.cpp new file mode 100644 index 0000000000..81c4960980 --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/MenuView.cpp @@ -0,0 +1,563 @@ +//-------------------------------------------------------------------- +// +// MenuView.cpp +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "constants.h" +#include "MenuView.h" +#include "MenuWindow.h" +#include "PostDispatchInvoker.h" +#include "stddlg.h" +#include "ViewLayoutFactory.h" + + +//==================================================================== +// MenuView Implementation + + +//-------------------------------------------------------------------- +// MenuView constructors, destructors, operators + +MenuView::MenuView(uint32 resizingMode) + : BView(BRect(0, 0, 0, 0), "Menu View", resizingMode, + B_WILL_DRAW) +{ + ViewLayoutFactory aFactory; // for semi-intelligent layout + + SetViewColor(BKG_GREY); + + // "hide user menus" check box + float fCheck_x = 20.0f; + float fCheck_y = 100.0f; + m_pHideUserCheck = aFactory.MakeCheckBox("Hide User Menus", + STR_HIDE_USER_MENUS, MSG_WIN_HIDE_USER_MENUS, + BPoint(fCheck_x, fCheck_y)); + m_pHideUserCheck->SetValue(B_CONTROL_OFF); + AddChild(m_pHideUserCheck); + + // "large test icons" check box + fCheck_y = m_pHideUserCheck->Frame().bottom + 10; + m_pLargeTestIconCheck = aFactory.MakeCheckBox("Large Test Icons", + STR_LARGE_TEST_ICONS, MSG_WIN_LARGE_TEST_ICONS, + BPoint(fCheck_x, fCheck_y)); + m_pLargeTestIconCheck->SetValue(B_CONTROL_OFF); + AddChild(m_pLargeTestIconCheck); + + // "add menu", "add item", "delete" buttons + BList buttons; + float fButton_x = m_pHideUserCheck->Frame().right + 15; + float fButton_y = m_pHideUserCheck->Frame().top; + + m_pAddMenuButton = aFactory.MakeButton("Add Menu Bar", STR_ADD_MENU, + MSG_VIEW_ADD_MENU, BPoint(fButton_x, fButton_y)); + AddChild(m_pAddMenuButton); + buttons.AddItem(m_pAddMenuButton); + + // for purposes of size calculation, use the longest piece + // of text we're going to stuff into the button + const char* addItemText; + float itemLen, sepLen; + itemLen = be_plain_font->StringWidth(STR_ADD_ITEM); + sepLen = be_plain_font->StringWidth(STR_ADD_SEP); + addItemText = (itemLen > sepLen) ? STR_ADD_ITEM : STR_ADD_SEP; + m_pAddItemButton = aFactory.MakeButton("Add Item To Menu", + addItemText, MSG_VIEW_ADD_ITEM, + BPoint(fButton_x, fButton_y)); + m_pAddItemButton->SetEnabled(false); + AddChild(m_pAddItemButton); + buttons.AddItem(m_pAddItemButton); + + m_pDelButton = aFactory.MakeButton("Delete Menu Bar", STR_DELETE_MENU, + MSG_VIEW_DELETE_MENU, BPoint(fButton_x, fButton_y)); + m_pDelButton->SetEnabled(false); + AddChild(m_pDelButton); + buttons.AddItem(m_pDelButton); + + // now resize list of buttons to max width + aFactory.ResizeToListMax(buttons, RECT_WIDTH); + + // now align buttons along left side + aFactory.Align(buttons, ALIGN_LEFT, + m_pAddItemButton->Frame().Height() + 15); + + // now make add menu the default, AFTER we've + // laid out the buttons, since the button bloats + // when it's the default + m_pAddMenuButton->MakeDefault(true); + + // item "label" control + float fEdit_left = 20.0f, fEdit_bottom = m_pHideUserCheck->Frame().top - 20; + float fEdit_right = m_pAddItemButton->Frame().right; + + m_pLabelCtrl = aFactory.MakeTextControl("Menu Bar Control", + STR_LABEL_CTRL, NULL, BPoint(fEdit_left, fEdit_bottom), + fEdit_right - fEdit_left, CORNER_BOTTOMLEFT); + AddChild(m_pLabelCtrl); + + // menu outline view + BRect r; + r.left = m_pAddItemButton->Frame().right + 30; + r.top = 20.0f; + r.right = r.left + 200 - B_V_SCROLL_BAR_WIDTH; + // API quirk here: <= 12 (hscroll height - 2) height + // results in scrollbar drawing error + r.bottom = r.top + 100 - B_H_SCROLL_BAR_HEIGHT; + + m_pMenuOutlineView = new BOutlineListView(r, "Menu Outline", + B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL); + m_pMenuOutlineView->SetSelectionMessage( + new BMessage(MSG_MENU_OUTLINE_SEL)); + + // wrap outline view in scroller + m_pScrollView = new BScrollView("Menu Outline Scroller", + m_pMenuOutlineView, B_FOLLOW_LEFT | B_FOLLOW_TOP, 0, + true, true); + m_pScrollView->SetViewColor(BKG_GREY); + AddChild(m_pScrollView); + +} + + + +//-------------------------------------------------------------------- +// MenuView virtual function overrides + +void MenuView::MessageReceived(BMessage* message) +{ + switch (message->what) { + case MSG_VIEW_ADD_MENU: + AddMenu(message); + break; + case MSG_VIEW_DELETE_MENU: + DeleteMenu(message); + break; + case MSG_VIEW_ADD_ITEM: + AddMenuItem(message); + break; + case MSG_MENU_OUTLINE_SEL: + MenuSelectionChanged(message); + break; + case MSG_LABEL_EDIT: + SetButtonState(); + break; + default: + BView::MessageReceived(message); + break; + } +} + +void MenuView::AllAttached(void) +{ + if (! Valid()) { + return; + } + + // Set button and view targets (now that window looper is available). + m_pAddMenuButton->SetTarget(this); + m_pDelButton->SetTarget(this); + m_pAddItemButton->SetTarget(this); + m_pMenuOutlineView->SetTarget(this); + + // Set button's initial state + SetButtonState(); + + // Wrap a message filter/invoker around the label control's text field + // that will post us B_LABEL_EDIT msg after the text field processes a + // B_KEY_DOWN message. + m_pLabelCtrl->TextView()->AddFilter( + new PostDispatchInvoker(B_KEY_DOWN, new BMessage(MSG_LABEL_EDIT), this)); + + // Get one item's height by adding a dummy item to + // the BOutlineListView and calculating its height. + m_pMenuOutlineView->AddItem(new BStringItem("Dummy")); + float itemHeight = m_pMenuOutlineView->ItemFrame(0).Height(); + itemHeight++; // account for 1-pixel offset between items + // which eliminates overlap + delete m_pMenuOutlineView->RemoveItem((int32)0); + + // Resize outline list view to integral item height. + // fudge factor of 4 comes from 2-pixel space between + // scrollview and outline list view on top & bottom + float viewHeight = 16*itemHeight; + m_pScrollView->ResizeTo(m_pScrollView->Frame().Width(), + viewHeight + B_H_SCROLL_BAR_HEIGHT + 4); + BScrollBar *pBar = m_pScrollView->ScrollBar(B_HORIZONTAL); + if (pBar) { + pBar->SetRange(0, 300); + } + + // Resize view to surround contents. + ViewLayoutFactory aFactory; + aFactory.ResizeAroundChildren(*this, BPoint(20,20)); +} + + + +//-------------------------------------------------------------------- +// MenuView operations + +void MenuView::PopulateUserMenu(BMenu* pMenu, int32 index) +{ + if ((! pMenu) || (! Valid())) { + return; + } + + // blow away all menu items + BMenuItem* pMenuItem = pMenu->RemoveItem((int32)0); + while(pMenuItem) { + delete pMenuItem; + pMenuItem = pMenu->RemoveItem((int32)0); + } + + // build menu up from outline list view + BListItem* pListItem = m_pMenuOutlineView->ItemUnderAt(NULL, true, index); + + // recursive buildup of menu items + BuildMenuItems(pMenu, pListItem, m_pMenuOutlineView); +} + + + +//-------------------------------------------------------------------- +// MenuView message handlers + +void MenuView::AddMenu(BMessage* message) +{ + if (! Valid()) { + return; + } + + const char* menuName = m_pLabelCtrl->Text(); + if ((! menuName) || (! *menuName)) { + BAlert* pAlert = new BAlert("Add menu alert", + "Please specify the menu name first.", "OK"); + pAlert->Go(); + return; + } + + m_pMenuOutlineView->AddItem(new BStringItem(menuName)); + + // add some info and pass to window + BMessage newMsg(MSG_WIN_ADD_MENU); + newMsg.AddString("Menu Name", menuName); + BWindow* pWin = Window(); + if (pWin) { + pWin->PostMessage(&newMsg); + } + + // Reset the label control and buttons + m_pLabelCtrl->SetText(""); + SetButtonState(); +} + +void MenuView::DeleteMenu(BMessage* message) +{ + if (! Valid()) + return; + + int32 itemCount; + int32 selected = m_pMenuOutlineView->CurrentSelection(); + if (selected < 0) + return; + + BStringItem* pSelItem = dynamic_cast + (m_pMenuOutlineView->ItemAt(selected)); + if (! pSelItem) + return; + + if (pSelItem->OutlineLevel() == 0) { + // get index of item among items in 0 level + itemCount = m_pMenuOutlineView->CountItemsUnder(NULL, true); + int32 i; + for (i=0; iItemUnderAt(NULL, true, i); + if (pItem == pSelItem) { + break; + } + } + + // Stuff the index into the message and pass along to + // the window. + BMessage newMsg(MSG_WIN_DELETE_MENU); + newMsg.AddInt32("Menu Index", i); + BWindow* pWin = Window(); + if (pWin) { + pWin->PostMessage(&newMsg); + } + } + + // Find & record all subitems of selection, because we'll + // have to delete them after they're removed from the list. + BList subItems; + int32 j; + itemCount = m_pMenuOutlineView->CountItemsUnder(pSelItem, false); + for (j=0; jItemUnderAt(pSelItem, false, j); + subItems.AddItem(pItem); + } + + // Note the superitem for reference just below + BStringItem* pSuperitem = dynamic_cast + (m_pMenuOutlineView->Superitem(pSelItem)); + + // Remove selected item and all subitems from + // the outline list view. + m_pMenuOutlineView->RemoveItem(pSelItem); // removes super- and subitems + + // Update window status + MenuWindow* pWin = dynamic_cast(Window()); + if (pWin) { + const char* itemName = pSelItem->Text(); + if (strcmp(itemName, STR_SEPARATOR)) { + pWin->UpdateStatus(STR_STATUS_DELETE_ITEM, itemName); + } else { + pWin->UpdateStatus(STR_STATUS_DELETE_SEPARATOR); + } + } + + // Delete the selected item and all subitems + for (j=0; j(subItems.ItemAt(j)); + delete pItem; // deletes subitems + } + delete pSelItem; // deletes superitem + + if (pSuperitem) { + // There's a bug in outline list view which does not + // update the superitem correctly. The only way to do so + // is to remove and add a brand-new superitem afresh. + if (! m_pMenuOutlineView->CountItemsUnder(pSuperitem, true)) + { + int32 index = m_pMenuOutlineView->FullListIndexOf(pSuperitem); + m_pMenuOutlineView->RemoveItem(pSuperitem); + BStringItem* pCloneItem = new BStringItem( + pSuperitem->Text(), pSuperitem->OutlineLevel()); + m_pMenuOutlineView->AddItem(pCloneItem, index); + delete pSuperitem; + } + } +} + +void MenuView::AddMenuItem(BMessage* message) +{ + if (! Valid()) { + return; + } + + // Add item to outline list view but DON'T update the + // window right away; the actual menu items will be + // created dynamically later on. + int32 selected = m_pMenuOutlineView->CurrentSelection(); + if (selected >= 0) { + BListItem* pSelItem = m_pMenuOutlineView->ItemAt(selected); + if (pSelItem) { + + int32 level = pSelItem->OutlineLevel() + 1; + int32 index = m_pMenuOutlineView->FullListIndexOf(pSelItem) + + m_pMenuOutlineView->CountItemsUnder(pSelItem, false) + 1; + const char* itemName = m_pLabelCtrl->Text(); + bool bIsSeparator = IsSeparator(itemName); + + if (bIsSeparator) { + m_pMenuOutlineView->AddItem(new BStringItem(STR_SEPARATOR, level), + index); + } else { + m_pMenuOutlineView->AddItem(new BStringItem(itemName, level), + index); + } + + MenuWindow* pWin = dynamic_cast(Window()); + if (pWin) { + if (! bIsSeparator) { + pWin->UpdateStatus(STR_STATUS_ADD_ITEM, itemName); + } else { + pWin->UpdateStatus(STR_STATUS_ADD_SEPARATOR); + } + } + + m_pMenuOutlineView->Invalidate(); // outline view doesn't + // invalidate correctly + + // Reset the label control the buttons + m_pLabelCtrl->SetText(""); + SetButtonState(); + } + } +} + +void MenuView::MenuSelectionChanged(BMessage* message) +{ + SetButtonState(); +} + + + +//-------------------------------------------------------------------- +// MenuView implementation member functions + +void MenuView::BuildMenuItems(BMenu* pMenu, BListItem* pSuperitem, + BOutlineListView* pView) +{ + if ((! pMenu) || (! pSuperitem) || (! pView)) { + return; + } + + int32 len = pView->CountItemsUnder(pSuperitem, true); + if (len == 0) { + BMenuItem* pEmptyItem = new BMenuItem(STR_MNU_EMPTY_ITEM, NULL); + pEmptyItem->SetEnabled(false); + pMenu->AddItem(pEmptyItem); + } + + for (int32 i=0; i + (pView->ItemUnderAt(pSuperitem, true, i)); + if (pItem) { + if (pView->CountItemsUnder(pItem, true) > 0) { + // add a submenu & fill it + BMenu* pNewMenu = new BMenu(pItem->Text()); + BuildMenuItems(pNewMenu, pItem, pView); + pMenu->AddItem(pNewMenu); + } else { + if (strcmp(pItem->Text(), STR_SEPARATOR)) { + // add a string item + BMessage* pMsg = new BMessage(MSG_USER_ITEM); + pMsg->AddString("Item Name", pItem->Text()); + pMenu->AddItem(new BMenuItem(pItem->Text(), pMsg)); + } else { + // add a separator item + pMenu->AddItem(new BSeparatorItem()); + } + } + } + } +} + +bool MenuView::IsSeparator(const char* text) const +{ + if (! text) { + return true; + } + + if (! *text) { + return true; + } + + int32 len = strlen(text); + for (int32 i = 0; i < len; i++) { + char ch = text[i]; + if ((ch != ' ') && (ch != '-')) { + return false; + } + } + + return true; +} + +void MenuView::SetButtonState(void) +{ + if (! Valid()) { + return; + } + + // See if an item in the outline list is selected + int32 index = m_pMenuOutlineView->CurrentSelection(); + bool bIsSelected = (index >= 0); + + // If an item is selected, see if the selected + // item is a separator + bool bSeparatorSelected = false; + if (bIsSelected) { + BStringItem* pItem = dynamic_cast + (m_pMenuOutlineView->ItemAt(index)); + if (pItem) { + bSeparatorSelected = (! strcmp(pItem->Text(), STR_SEPARATOR)); + } + } + + // Delete: enable if anything is selected + m_pDelButton->SetEnabled(bIsSelected); + + // Add Item: enable if anything but a separator is selected + bool bEnableAddItem = bIsSelected && (! bSeparatorSelected); + m_pAddItemButton->SetEnabled(bEnableAddItem); + + // Add Menu: enable if there's any text in the label field + const char* labelText = m_pLabelCtrl->Text(); + m_pAddMenuButton->SetEnabled(labelText && (*labelText)); + + // Add Item: text says Add Separator if button is enabled + // and the label field contains separator text, + // Add Item otherwise + const char* itemText; + if (bEnableAddItem && IsSeparator(labelText)) { + itemText = STR_ADD_SEP; + } else { + itemText = STR_ADD_ITEM; + } + m_pAddItemButton->SetLabel(itemText); + + // If add item button is enabled, it should be the default + if (bEnableAddItem) { + m_pAddItemButton->MakeDefault(true); + } else { + m_pAddMenuButton->MakeDefault(true); + } +} + +bool MenuView::Valid(void) +{ + if (! m_pLabelCtrl) { + ierror(STR_NO_LABEL_CTRL); + return false; + } + if (! m_pHideUserCheck) { + ierror(STR_NO_HIDE_USER_CHECK); + return false; + } + if (! m_pLargeTestIconCheck) { + ierror(STR_NO_LARGE_ICON_CHECK); + return false; + } + if (! m_pAddMenuButton) { + ierror(STR_NO_ADDMENU_BUTTON); + return false; + } + if (! m_pAddItemButton) { + ierror(STR_NO_ADDITEM_BUTTON); + return false; + } + if (! m_pDelButton) { + ierror(STR_NO_DELETE_BUTTON); + return false; + } + if (! m_pMenuOutlineView) { + ierror(STR_NO_MENU_OUTLINE); + return false; + } + if (! m_pScrollView) { + ierror(STR_NO_MENU_SCROLL_VIEW); + return false; + } + return true; +} + diff --git a/src/tests/kits/interface/menu/menuworld/MenuView.h b/src/tests/kits/interface/menu/menuworld/MenuView.h new file mode 100644 index 0000000000..b09605c280 --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/MenuView.h @@ -0,0 +1,85 @@ +//-------------------------------------------------------------------- +// +// MenuView.h +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#ifndef _MenuView_h +#define _MenuView_h + + +#include + +class BButton; +class BListItem; +class BOutlineListView; +class BStringView; +class BTextControl; +//==================================================================== +// CLASS: MenuView + +class MenuView : public BView +{ + //---------------------------------------------------------------- + // Constructors, destructors, operators + +public: + MenuView(uint32 resizingMode); + + + //---------------------------------------------------------------- + // Virtual member function overrides + +public: + void MessageReceived(BMessage* message); + void AllAttached(void); + + + //---------------------------------------------------------------- + // Operations +public: + void PopulateUserMenu(BMenu* pMenu, int32 index); + + //---------------------------------------------------------------- + // Message handlers + +private: + void AddMenu(BMessage* message); + void DeleteMenu(BMessage* message); + void AddMenuItem(BMessage* message); + void MenuSelectionChanged(BMessage* message); + + + //---------------------------------------------------------------- + // Implementation member functions + +private: + void BuildMenuItems(BMenu* pMenu, BListItem* superitem, + BOutlineListView* pView); + bool IsSeparator(const char* text) const; + void SetButtonState(void); + bool Valid(void); + + + //---------------------------------------------------------------- + // Member variables + +private: + BTextControl* m_pLabelCtrl; + BCheckBox* m_pHideUserCheck; + BCheckBox* m_pLargeTestIconCheck; + BButton* m_pAddMenuButton; + BButton* m_pDelButton; + BButton* m_pAddItemButton; + BOutlineListView* m_pMenuOutlineView; + BScrollView* m_pScrollView; +}; + +#endif /* _MenuView_h */ diff --git a/src/tests/kits/interface/menu/menuworld/MenuWindow.cpp b/src/tests/kits/interface/menu/menuworld/MenuWindow.cpp new file mode 100644 index 0000000000..ea5b804bc8 --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/MenuWindow.cpp @@ -0,0 +1,358 @@ +//-------------------------------------------------------------------- +// +// MenuWindow.cpp +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "constants.h" +#include "MenuView.h" +#include "MenuWindow.h" +#include "stddlg.h" + +//==================================================================== +// MenuWindow Implementation + +#define MAX_TEST_STATUS_CHARS 25 + + +//-------------------------------------------------------------------- +// MenuWindow constructors, destructors, operators + +MenuWindow::MenuWindow(const char* name) + : BWindow(BRect(60,60,60,60), name, B_TITLED_WINDOW, + B_NOT_RESIZABLE | B_NOT_ZOOMABLE) +{ + m_bUsingFullMenuBar = true; + + // menu bars + BRect dummyFrame(0, 0, 0, 0); + m_pFullMenuBar = new BMenuBar(dummyFrame, "Full Menu Bar"); + m_pHiddenMenuBar = new BMenuBar(dummyFrame, "Menu Bar w. Hidden User Menus"); + + // File menu + BMenu* pMenu = BuildFileMenu(); + if (pMenu) { + m_pFullMenuBar->AddItem(pMenu); + } + pMenu = BuildFileMenu(); + if (pMenu) { + m_pHiddenMenuBar->AddItem(pMenu); + } + + // Test menu + pMenu = m_testMenuBuilder.BuildTestMenu(B_MINI_ICON); + if (pMenu) { + m_pFullMenuBar->AddItem(pMenu); + } + pMenu = m_testMenuBuilder.BuildTestMenu(B_MINI_ICON); + if (pMenu) { + m_pHiddenMenuBar->AddItem(pMenu); + } + + // add child after menus are added so its initially + // calculated app_server bounds take added menus into + // account + AddChild(m_pFullMenuBar); + + float menuHeight = m_pFullMenuBar->Bounds().Height(); + + // Menu view + m_pMenuView = new MenuView(B_FOLLOW_NONE); // don't follow window just yet! + m_pMenuView->MoveBy(0, menuHeight + 1); + AddChild(m_pMenuView); + + // Status view + BRect menuViewRect = m_pMenuView->Frame(); + float top = menuViewRect.bottom + 1; + font_height plainHeight; + be_plain_font->GetHeight(&plainHeight); + + // Simulate a vertical divider by making a BBox where only the top side + // can be seen in the window. + BRect boxFrame; + boxFrame.Set(menuViewRect.left - 2, + top, + menuViewRect.right + 2, + top + plainHeight.ascent + plainHeight.descent + plainHeight.leading + 4); + + BBox* pStatusBox = new BBox(boxFrame); + AddChild(pStatusBox); + + BRect statusFrame = pStatusBox->Bounds(); + statusFrame.InsetBy(2,2); + m_pStatusView = new BStringView(statusFrame, "Status View", STR_STATUS_DEFAULT, + B_FOLLOW_ALL); // don't follow window just yet! + m_pStatusView->SetViewColor(BKG_GREY); + pStatusBox->AddChild(m_pStatusView); + + // Resize window dynamically to fit MenuView (and Status View) + float windowWidth = m_pMenuView->Frame().right; + float windowHeight = boxFrame.bottom - 4; + ResizeTo(windowWidth, windowHeight); +} + + + +//-------------------------------------------------------------------- +// MenuWindow virtual function overrides + +void MenuWindow::MenusBeginning(void) +{ + if ((! Valid()) || (! m_bUsingFullMenuBar)) { + return; + } + + int32 len = m_pFullMenuBar->CountItems(); + for (int32 i = 2; i < len; i++) // skipping File and Test menus + { + BMenu* pMenu = m_pFullMenuBar->SubmenuAt(i); + if (pMenu) { + m_pMenuView->PopulateUserMenu(pMenu, i - 2); + } + } +} + +void MenuWindow::MessageReceived(BMessage* message) +{ + switch (message->what) { + case MSG_WIN_ADD_MENU: + AddMenu(message); + break; + case MSG_WIN_DELETE_MENU: + DeleteMenu(message); + break; + case MSG_TEST_ITEM: + TestMenu(message); + break; + case MSG_USER_ITEM: + UserMenu(message); + break; + case MSG_WIN_HIDE_USER_MENUS: + ToggleUserMenus(message); + break; + case MSG_WIN_LARGE_TEST_ICONS: + ToggleTestIcons(message); + break; + default: + BWindow::MessageReceived(message); + break; + } +} + +bool MenuWindow::QuitRequested(void) +{ + be_app->PostMessage(B_QUIT_REQUESTED); + return true; +} + + + +//-------------------------------------------------------------------- +// MenuWindow operations + +void MenuWindow::UpdateStatus(const char* str1, const char* str2) +{ + uint32 lenTotal = 0, len1 = 0, len2 = 0; + + if (str1) + len1 = strlen(str1); + if (str2) + len2 = strlen(str2); + + lenTotal = len1 + len2; + char* updateText = new char[lenTotal+1]; + updateText[0] = '\0'; // in case str1 and str2 are both NULL + + if (str1) + strcpy(updateText, str1); + if (str2) + strcpy(updateText + len1, str2); + + if (Lock() && Valid()) { + m_pStatusView->SetText(updateText); + Unlock(); + } + + delete [] updateText; +} + + + +//-------------------------------------------------------------------- +// MenuWindow message handlers + +void MenuWindow::AddMenu(BMessage* message) +{ + if (! Valid()) { + return; + } + + const char* menuName; + if (message->FindString("Menu Name", &menuName) == B_OK) { + m_pFullMenuBar->AddItem(new BMenu(menuName)); + UpdateStatus(STR_STATUS_ADD_MENU, menuName); + } +} + +void MenuWindow::DeleteMenu(BMessage* message) +{ + if (! Valid()) { + return; + } + + int32 i; + if (message->FindInt32("Menu Index", &i) == B_OK) { + BMenuItem* pItem = m_pFullMenuBar->ItemAt(i+2); + if (pItem) { + // menu index is the above index + 2 (for File and Test menus) + m_pFullMenuBar->RemoveItem(pItem); + UpdateStatus(STR_STATUS_DELETE_MENU, pItem->Label()); + delete pItem; + } + } +} + +void MenuWindow::TestMenu(BMessage* message) +{ + if (! Valid()) { + return; + } + + int32 i; + if (message->FindInt32("Item Index", &i) == B_OK) { + char numText[3]; + sprintf(numText, "%ld", i); + UpdateStatus(STR_STATUS_TEST, numText); + } +} + +void MenuWindow::UserMenu(BMessage* message) +{ + if (! Valid()) { + return; + } + + const char* itemName; + if (message->FindString("Item Name", &itemName) == B_OK) { + UpdateStatus(STR_STATUS_USER, itemName); + } +} + +void MenuWindow::ToggleUserMenus(BMessage* message) +{ + if (! Valid()) { + return; + } + + void* pSrc; + bool useFullMenus = false; + + if (message->FindPointer("source", &pSrc) == B_OK) { + BCheckBox* pCheckBox = reinterpret_cast(pSrc); + useFullMenus = (pCheckBox->Value() == B_CONTROL_OFF); + } + + if ((! useFullMenus) && m_bUsingFullMenuBar) { + RemoveChild(m_pFullMenuBar); + AddChild(m_pHiddenMenuBar); + m_bUsingFullMenuBar = false; + } else if (useFullMenus && (! m_bUsingFullMenuBar)) { + RemoveChild(m_pHiddenMenuBar); + AddChild(m_pFullMenuBar); + m_bUsingFullMenuBar = true; + } +} + +void MenuWindow::ToggleTestIcons(BMessage* message) +{ + if (! Valid()) { + return; + } + + void* pSrc; + icon_size size = B_MINI_ICON; + + if (message->FindPointer("source", &pSrc) == B_OK) { + BCheckBox* pCheckBox = reinterpret_cast(pSrc); + size = (pCheckBox->Value() == B_CONTROL_ON) ? B_LARGE_ICON : B_MINI_ICON; + } + + ReplaceTestMenu(m_pFullMenuBar, size); + ReplaceTestMenu(m_pHiddenMenuBar, size); +} + + + +//-------------------------------------------------------------------- +// MenuWindow implementation member functions + +bool MenuWindow::Valid(void) const +{ + if (! m_pFullMenuBar) { + ierror(STR_NO_FULL_MENU_BAR); + return false; + } + if (! m_pHiddenMenuBar) { + ierror(STR_NO_HIDDEN_MENU_BAR); + return false; + } + if (! m_pMenuView) { + ierror(STR_NO_MENU_VIEW); + return false; + } + if (! m_pStatusView) { + ierror(STR_NO_STATUS_VIEW); + return false; + } + return true; +} + +BMenu* MenuWindow::BuildFileMenu(void) const +{ + BMenu* pMenu = new BMenu(STR_MNU_FILE); + + BMenuItem* pAboutItem = new BMenuItem(STR_MNU_FILE_ABOUT, + new BMessage(B_ABOUT_REQUESTED)); + pAboutItem->SetTarget(NULL, be_app); + pMenu->AddItem(pAboutItem); + + pMenu->AddSeparatorItem(); + + pMenu->AddItem(new BMenuItem(STR_MNU_FILE_CLOSE, + new BMessage(B_QUIT_REQUESTED), CMD_FILE_CLOSE)); + + return pMenu; +} + +void MenuWindow::ReplaceTestMenu(BMenuBar* pMenuBar, icon_size size) +{ + if (! pMenuBar) { + return; + } + + BMenu* pTestMenu = m_testMenuBuilder.BuildTestMenu(size); + if (pTestMenu) { + BMenuItem* pPrevItem = pMenuBar->RemoveItem(1); + if (pPrevItem) { + delete pPrevItem; + } + pMenuBar->AddItem(pTestMenu, 1); + } +} diff --git a/src/tests/kits/interface/menu/menuworld/MenuWindow.h b/src/tests/kits/interface/menu/menuworld/MenuWindow.h new file mode 100644 index 0000000000..b76bee8d20 --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/MenuWindow.h @@ -0,0 +1,90 @@ +//-------------------------------------------------------------------- +// +// MenuWindow.h +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#ifndef _MenuWindow_h +#define _MenuWindow_h + +#include + +#include +#include "TestMenuBuilder.h" + +class MenuView; +class BButton; +class BListItem; +class BOutlineListView; +class BStringView; +class BTextControl; + +//==================================================================== +// CLASS: MenuWindow + +class MenuWindow : public BWindow +{ + //---------------------------------------------------------------- + // Constructors, destructors, operators + +public: + MenuWindow(const char* name); + + + //---------------------------------------------------------------- + // Virtual member function overrides + +public: + void MenusBeginning(void); + void MessageReceived(BMessage* message); + bool QuitRequested(void); + + + //---------------------------------------------------------------- + // Operations + +public: + void UpdateStatus(const char* str1 = NULL, + const char* str2 = NULL); + + + //---------------------------------------------------------------- + // Message handlers + +private: + void AddMenu(BMessage* message); + void DeleteMenu(BMessage* message); + void TestMenu(BMessage* message); + void UserMenu(BMessage* message); + void ToggleUserMenus(BMessage* message); + void ToggleTestIcons(BMessage* message); + + + //---------------------------------------------------------------- + // Implementation member functions + +private: + bool Valid(void) const; + BMenu* BuildFileMenu(void) const; + void ReplaceTestMenu(BMenuBar* pMenuBar, icon_size size); + + //---------------------------------------------------------------- + // Member variables + +private: + BMenuBar* m_pFullMenuBar; + BMenuBar* m_pHiddenMenuBar; + bool m_bUsingFullMenuBar; + BStringView* m_pStatusView; + MenuView* m_pMenuView; + TestMenuBuilder m_testMenuBuilder; +}; + +#endif /* _MenuWindow_h */ diff --git a/src/tests/kits/interface/menu/menuworld/MenuWorld.rsrc b/src/tests/kits/interface/menu/menuworld/MenuWorld.rsrc new file mode 100644 index 0000000000..2f1b6d0bbf Binary files /dev/null and b/src/tests/kits/interface/menu/menuworld/MenuWorld.rsrc differ diff --git a/src/tests/kits/interface/menu/menuworld/PostDispatchInvoker.cpp b/src/tests/kits/interface/menu/menuworld/PostDispatchInvoker.cpp new file mode 100644 index 0000000000..e8d9f614d2 --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/PostDispatchInvoker.cpp @@ -0,0 +1,45 @@ +//-------------------------------------------------------------------- +// +// PostDispatchInvoker.cpp +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#include "PostDispatchInvoker.h" +#include + +//==================================================================== +// PostDispatchInvoker Implementation + + +//-------------------------------------------------------------------- +// PostDispatchInvoker constructors, destructors, operators + +PostDispatchInvoker::PostDispatchInvoker(uint32 cmdFilter, + BMessage* invokeMsg, BHandler* invokeHandler, + BLooper* invokeLooper) + : BMessageFilter(cmdFilter, NULL), + BInvoker(invokeMsg, invokeHandler, invokeLooper) +{ } + + + +//-------------------------------------------------------------------- +// PostDispatchInvoker virtual function overrides + +filter_result PostDispatchInvoker::Filter(BMessage* message, + BHandler** target) +{ + Looper()->DispatchMessage(message, *target); + BMessage* pInvMsg = Message(); + pInvMsg->AddMessage("Dispatched Message", message); + pInvMsg->AddPointer("Dispatch Target", *target); + Invoke(); + return B_SKIP_MESSAGE; +} diff --git a/src/tests/kits/interface/menu/menuworld/PostDispatchInvoker.h b/src/tests/kits/interface/menu/menuworld/PostDispatchInvoker.h new file mode 100644 index 0000000000..3ef27fa58c --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/PostDispatchInvoker.h @@ -0,0 +1,53 @@ +//-------------------------------------------------------------------- +// +// PostDispatchInvoker.h +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#ifndef _PostDispatchInvoker_h +#define _PostDispatchInvoker_h + +#include +#include + +//==================================================================== +// CLASS: PostDispatchInvoker +// --------------------------- +// A simple kind of message filter which, when it receives a +// message of the target type, dispatches it directly to the +// looper, then posts a message to a specified handler when +// the dispatch is completed. Two fields are appended to the +// message before it is delivered: +// Dispatched Message B_MESSAGE_TYPE +// Dispatch Target B_POINTER_TYPE (BHandler*) +// +// Most message filters are designed to intercept messages +// before they're delievered; this one allows you to do some +// handling after they've been delivered. + +class PostDispatchInvoker : public BMessageFilter, public BInvoker +{ + //---------------------------------------------------------------- + // Constructors, destructors, operators + +public: + PostDispatchInvoker(uint32 cmdFilter, + BMessage* invokeMsg, BHandler* invokeHandler, + BLooper* invokeLooper = NULL); + + + //---------------------------------------------------------------- + // Virtual member function overrides + +public: + filter_result Filter(BMessage* message, BHandler** target); +}; + +#endif /* _PostDispatchInvoker_h */ \ No newline at end of file diff --git a/src/tests/kits/interface/menu/menuworld/TestIcons.h b/src/tests/kits/interface/menu/menuworld/TestIcons.h new file mode 100644 index 0000000000..59681b5490 --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/TestIcons.h @@ -0,0 +1,584 @@ +//-------------------------------------------------------------------- +// +// TestIcons.h +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#ifndef _TestIcons_h +#define _TestIcons_h + +//-------------------------------------------------------------------- +// These icons were generated with the help of the File Types +// preference panel. I created these icons by editing the +// resource file icons, using the File Types preference panel +// and Icon-O-Matic. Then, I selected the menu command +// File>Dump Icons in Icon-O-Matic. Finally, I copied and +// pasted the icon data from the newly generated ~/Bitmaps.h. + +#define NUM_TEST_ITEMS_ACROSS 3 +#define NUM_TEST_ITEMS_DOWN 2 + +#define LARGE_ICON_BYTES 1024 + +const uint8 kLargeIconWidth = 32; +const uint8 kLargeIconHeight = 32; +const color_space kLargeIconColorSpace = B_COLOR_8_BIT; + +#define MINI_ICON_BYTES 256 + +const uint8 kMiniIconWidth = 16; +const uint8 kMiniIconHeight = 16; +const color_space kMiniIconColorSpace = B_COLOR_8_BIT; + +//-------------------------------------------------------------------- +// Large Test Icons + +extern const uint8 +kLargeTestI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b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31, + 0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x1b,0x1b,0x1b,0x1b,0x1b +}, + +{ /* Icon 2 */ + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20, + 0x20,0x20,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x26,0x26, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x26,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x26,0x26,0x1b,0x1b, + 0x26,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x26,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x26,0x1b,0x1b,0x1b, + 0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x26,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x26,0x26,0x26,0x26,0x26,0x26,0x26,0x26,0x1b,0x1b,0x1b, + 0x20,0x20,0x20,0x20,0x20,0x20,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x20,0x20, + 0x20,0x26,0x26,0x28,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x26,0x28,0x28,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x26, + 0x28,0x28,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x26,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x26,0x28,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x26,0x28,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x26,0x28,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x26,0x28,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x26,0x28,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x26,0x28,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x26,0x26,0x26,0x26,0x26,0x26,0x26,0x26,0x26,0x26,0x26, + 0x26,0x26,0x26,0x26,0x26,0x26,0x26,0x26,0x26,0x26,0x28,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28, + 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x1b,0x1b,0x1b,0x1b,0x1b +}, + +{ /* Icon 3 */ + 0x1b,0x1b,0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x3b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x3b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x3b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x3b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x3b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x3b,0x3b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x3b,0x3b,0x3b,0x3b,0x3b,0x3b,0x3b,0x3b,0x35,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,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39,0x35,0x35,0x35,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x3b,0x3b,0x39,0x35,0x35,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x3b,0x39,0x35,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x3b,0x39,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x3b,0x39, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x1b,0x1b,0x1b,0x1b,0x3b, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x3b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x3b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x1b,0x1b,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x3b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x3b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x39,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x3b,0x3b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x39,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x3b,0x3b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x3b,0x39,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x3b,0x3b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x3b,0x39,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, + 0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x3b,0x3b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x3b,0x39,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35, + 0x35,0x35,0x35,0x35,0x35,0x39,0x3b,0x3b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1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52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x92,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x1b,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x92,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x92,0x92,0x92,0x92,0x92,0x92,0xd2,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0xd2,0xd2,0xd2,0xd2,0xd2,0xd2,0xd2,0xd2,0xd2,0xd2,0xd2,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0xd2,0xd2,0xd2,0xd2,0xd2,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x52, + 0x52,0x52,0x52,0x52,0x52,0x52,0x92,0xd2,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x52, + 0x52,0x52,0x52,0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1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0xef,0xef,0xef,0xef,0xef, + 0xef,0xef,0xef,0xef,0xef,0xef,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b +} + +}}; + +//-------------------------------------------------------------------- +// Mini Test Icons + +extern const uint8 +kMiniTestIcons[NUM_TEST_ITEMS_DOWN][NUM_TEST_ITEMS_ACROSS][MINI_ICON_BYTES] = +{ +{ /* 1st row */ + +{ /* Icon 1 */ + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x2a,0x2a,0x2a,0x2a,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x2a,0x2a,0x2a,0x2a,0x2a,0x2f,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2f,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2f,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2f,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2f,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x2a,0x2a,0x2f,0x2a,0x2a,0x2a,0x2a,0x2a,0x2f,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x2a,0x2f,0x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1b, + 0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x26,0x26,0x20,0x20,0x20,0x20,0x26,0x1b,0x1b, + 0x1b,0x1b,0x20,0x20,0x20,0x20,0x26,0x1b,0x1b,0x20,0x20,0x20,0x20,0x26,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x26,0x26,0x26,0x26,0x1b,0x20,0x20,0x20,0x20,0x20,0x26,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x26,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x26,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x26,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x26,0x26,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x26,0x1b,0x1b, + 0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x26,0x1b,0x1b, + 0x1b,0x1b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x26,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x26,0x26,0x26,0x26,0x26,0x26,0x26,0x26,0x26,0x26,0x26,0x1b,0x1b +}, + +{ /* Icon 3 */ + 0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x1b,0x1b, + 0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x1b,0x1b, + 0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x39,0x39,0x39,0x39,0x35,0x35,0x35,0x35,0x35,0x39,0x39,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x39,0x39,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x39,0x39,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x35,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x39,0x39,0x35,0x35,0x35,0x35,0x35,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x39,0x35,0x35,0x35,0x35,0x35,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x35,0x35,0x35,0x35,0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x39,0x1b,0x1b, + 0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x1b,0x1b, + 0x1b,0x1b,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x39,0x1b,0x1b, + 0x1b,0x1b,0x39,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x39,0x39,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x39,0x39,0x35,0x35,0x35,0x35,0x39,0x39,0x39,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x39,0x39,0x39,0x39,0x39,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b +} + +}, /* end of 1st row */ + +{ /* 2nd row */ + +{ /* Icon 4 */ + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x92,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x92,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x92,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x52,0x52,0x52,0x52,0x52,0x92,0x52,0x52,0x52,0x52,0x92,0x1b,0x1b,0x1b, + 0x1b,0x52,0x52,0x52,0x52,0x52,0x92,0x1b,0x52,0x52,0x52,0x52,0x92,0x1b,0x1b,0x1b, + 0x1b,0x52,0x52,0x52,0x52,0x92,0x1b,0x1b,0x52,0x52,0x52,0x52,0x92,0x1b,0x1b,0x1b, + 0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x1b,0x1b, + 0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x92,0x1b, + 0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x92,0x1b, + 0x1b,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x92,0x1b, + 0x1b,0x1b,0x92,0x92,0x92,0x92,0x92,0x92,0x52,0x52,0x52,0x52,0x92,0x92,0x92,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x52,0x52,0x52,0x52,0x92,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x52,0x52,0x52,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e9,0xe0,0xe0,0xe0,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0x1b,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0x1b,0x1b,0x1b,0x1b, + 0x1b,0x1b,0xe0,0xe0,0xe0,0xe0,0xe0,0xe9,0xe9,0xe0,0xe0,0xe0,0xe0,0x1b,0x1b,0x1b, + 0x1b,0x1b,0xe0,0xe0,0xe0,0xe0,0xe9,0xe9,0x1b,0xe9,0xe0,0xe0,0xe0,0xe9,0x1b,0x1b, + 0x1b,0x1b,0xe0,0xe0,0xe0,0xe0,0xe0,0x1b,0x1b,0xe0,0xe0,0xe0,0xe0,0xe9,0x1b,0x1b, + 0x1b,0x1b,0xe9,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe9,0x1b,0x1b, + 0x1b,0x1b,0x1b,0xe9,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe9,0xe9,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0xe9,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe9,0xe9,0x1b,0x1b,0x1b, + 0x1b,0x1b,0x1b,0x1b,0x1b,0xe9,0xe9,0xe9,0xe9,0xe9,0xe9,0xe9,0x1b,0x1b,0x1b,0x1b +} + +}}; + +#endif /* _TestIcons_h */ \ No newline at end of file diff --git a/src/tests/kits/interface/menu/menuworld/TestMenuBuilder.cpp b/src/tests/kits/interface/menu/menuworld/TestMenuBuilder.cpp new file mode 100644 index 0000000000..f3a7d90d4b --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/TestMenuBuilder.cpp @@ -0,0 +1,137 @@ +//-------------------------------------------------------------------- +// +// TestMenuBuilder.cpp +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#include +#include +#include +#include +#include +#include + +#include "constants.h" +#include "TestIcons.h" +#include "TestMenuBuilder.h" +#include "BitmapMenuItem.h" + +//==================================================================== +// TestMenuBuilder Implementation + +#define TEST_NAME_LENGTH 20 + + + +//-------------------------------------------------------------------- +// TestMenuBuilder entry point + +BMenu* TestMenuBuilder::BuildTestMenu(icon_size size) +{ + BitmapMenuItem *pItemArray[NUM_TEST_ITEMS_DOWN][NUM_TEST_ITEMS_ACROSS]; + BitmapMenuItem *pTypicalItem = NULL; + + // fill the array of bitmap menu items + for (int32 i=0; iAddInt32("Item Index", itemIndex); + char shortcut = '0' + itemIndex; // the item's number + BitmapMenuItem *pItem = new BitmapMenuItem(name, *pBitmap, + pTestMsg, shortcut, 0); + pItemArray[i][j] = pItem; + pTypicalItem = pItem; + } + delete pBitmap; + } + } + + float menuHeight, menuWidth; + + // Simplifying assumption: All test items have same width and height. + // Use pTypicalItem to calculate frames. + if (! pTypicalItem) { + // no items to put in a menu + return NULL; + } + float itemHeight, itemWidth; + pTypicalItem->GetBitmapSize(&itemWidth, &itemHeight); + itemWidth++; // take space between items into account + itemHeight++; + + menuWidth = NUM_TEST_ITEMS_ACROSS*itemWidth; + menuHeight = NUM_TEST_ITEMS_DOWN*itemHeight; + + // create menu + float left, top; + BRect frame; + BMenu* pMenu = new BMenu(STR_MNU_TEST, menuWidth, menuHeight); + for (int32 i=0; iAddItem(pItem, frame); + } + } + } + + return pMenu; +} + +//-------------------------------------------------------------------- +// TestMenuBuilder implementation member functions + +BBitmap* TestMenuBuilder::LoadTestBitmap(int32 i, int32 j, icon_size size) +{ + BBitmap* pBitmap; + const uint8* bits; + uint32 byteLen; + color_space iconColorSpace; + BRect iconBounds(0,0,0,0); + + if ((i < 0) || (j < 0)) { + return NULL; + } + + if ((i >= NUM_TEST_ITEMS_DOWN) || (j >= NUM_TEST_ITEMS_ACROSS)) { + return NULL; + } + + if (size == B_LARGE_ICON) { + bits = kLargeTestIcons[i][j]; + byteLen = LARGE_ICON_BYTES; + iconBounds.right = kLargeIconWidth - 1; // 0 counts as a pixel! + iconBounds.bottom = kLargeIconHeight - 1; + iconColorSpace = kLargeIconColorSpace; + } else { + bits = kMiniTestIcons[i][j]; + byteLen = MINI_ICON_BYTES; + iconBounds.right = kMiniIconWidth - 1; + iconBounds.bottom = kMiniIconHeight - 1; + iconColorSpace = kMiniIconColorSpace; + } + + pBitmap = new BBitmap(iconBounds, iconColorSpace); + uint8* destBits = (uint8*)pBitmap->Bits(); + memcpy(destBits, bits, byteLen); + + return pBitmap; +} diff --git a/src/tests/kits/interface/menu/menuworld/TestMenuBuilder.h b/src/tests/kits/interface/menu/menuworld/TestMenuBuilder.h new file mode 100644 index 0000000000..63c4ab0607 --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/TestMenuBuilder.h @@ -0,0 +1,39 @@ +//-------------------------------------------------------------------- +// +// TestMenuBuilder.h +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#ifndef _TestMenuBuilder_h +#define _TestMenuBuilder_h + +#include +#include /* for icon_size */ + +//==================================================================== +// CLASS: TestMenuBuilder + +class TestMenuBuilder +{ + //---------------------------------------------------------------- + // Entry point + +public: + BMenu* BuildTestMenu(icon_size size); + + + //---------------------------------------------------------------- + // Implementation member functions + +private: + BBitmap* LoadTestBitmap(int32 i, int32 j, icon_size size); +}; + +#endif /* _TestMenuBuilder_h */ diff --git a/src/tests/kits/interface/menu/menuworld/ViewLayoutFactory.cpp b/src/tests/kits/interface/menu/menuworld/ViewLayoutFactory.cpp new file mode 100644 index 0000000000..01d787279c --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/ViewLayoutFactory.cpp @@ -0,0 +1,261 @@ +//-------------------------------------------------------------------- +// +// ViewLayoutFactory.cpp +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#include "ViewLayoutFactory.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +template +inline T average(const T& x, const T& y) +{ + return (x + y) / 2; +} + + +//-------------------------------------------------------------------- +// ViewLayoutFactory factory generators + +BButton* ViewLayoutFactory::MakeButton(const char* name, const char* label, + uint32 msgID, BPoint pos, corner posRef) +{ + BRect dummyFrame(0,0,0,0); + BButton* pButton = new BButton(dummyFrame, name, label, + new BMessage(msgID)); + pButton->ResizeToPreferred(); + MoveViewCorner(*pButton, pos, posRef); + return pButton; +} + +BCheckBox* ViewLayoutFactory::MakeCheckBox(const char* name, + const char* label, uint32 msgID, BPoint pos, corner posRef) +{ + BRect dummyFrame(0,0,0,0); + BCheckBox* pCheckBox = new BCheckBox(dummyFrame, name, label, + new BMessage(msgID)); + pCheckBox->ResizeToPreferred(); + MoveViewCorner(*pCheckBox, pos, posRef); + return pCheckBox; +} + +BTextControl* ViewLayoutFactory::MakeTextControl(const char* name, + const char* label, const char* text, BPoint pos, float controlWidth, + corner posRef) +{ + // Note: this function is almost identical to the regular + // BTextControl constructor, but it minimizes the label + // width and maximizes the field width, instead of divvying + // them up half-&-half or 2 : 3, and gives the standard + // flexibility of corner positioning. + BRect dummyFrame(0,0,0,0); + BTextControl* pCtrl = new BTextControl(dummyFrame, name, label, + text, NULL); + LayoutTextControl(*pCtrl, pos, controlWidth, posRef); + return pCtrl; +} + +void ViewLayoutFactory::LayoutTextControl(BTextControl& control, + BPoint pos, float controlWidth, corner posRef) +{ + control.ResizeToPreferred(); + BTextView* pTextView = control.TextView(); + float widthExpand = controlWidth; + widthExpand -= control.Bounds().Width(); + if (widthExpand > 0) { + control.ResizeBy(widthExpand, 0); + pTextView->ResizeBy(widthExpand, 0); + } + MoveViewCorner(control, pos, posRef); +} + + + +//-------------------------------------------------------------------- +// ViewLayoutFactory implementation member functions + +void ViewLayoutFactory::MoveViewCorner(BView& view, BPoint pos, corner posRef) +{ + BRect frame = view.Frame(); + BPoint topLeft; + switch (posRef) { + case CORNER_TOPLEFT: + topLeft = pos; + break; + case CORNER_BOTTOMLEFT: + topLeft.x = pos.x; + topLeft.y = pos.y - frame.Height(); + break; + case CORNER_TOPRIGHT: + topLeft.x = pos.x - frame.Width(); + topLeft.y = pos.y; + break; + case CORNER_BOTTOMRIGHT: + topLeft.x = pos.x - frame.Width(); + topLeft.y = pos.y - frame.Height(); + break; + } + + view.MoveTo(topLeft); +} + +void ViewLayoutFactory::Align(BList& viewList, align_side side, + float alignLen) +{ + int32 i, len = viewList.CountItems(); + if (len <= 1) { + return; + } + + // make sure alignment is recognized + if ((side != ALIGN_LEFT) && (side != ALIGN_TOP) + && (side != ALIGN_RIGHT) && (side != ALIGN_BOTTOM) + && (side != ALIGN_HCENTER) && (side != ALIGN_VCENTER)) + { + return; + } + + // find initial location for placement, based on head item + BPoint viewLoc; + BView* pView = reinterpret_cast(viewList.ItemAt(0)); + if (! pView) { + return; + } + + BRect frame = pView->Frame(); + switch (side) { + case ALIGN_LEFT: + case ALIGN_TOP: + viewLoc.Set(frame.left, frame.top); + break; + case ALIGN_RIGHT: + viewLoc.Set(frame.right, frame.top); + break; + case ALIGN_BOTTOM: + viewLoc.Set(frame.left, frame.bottom); + break; + case ALIGN_HCENTER: + viewLoc.Set(frame.left, average(frame.top, frame.bottom)); + break; + case ALIGN_VCENTER: + viewLoc.Set(average(frame.left, frame.right), frame.top); + printf("Aligning along vcenter\nInitial position: "); + viewLoc.PrintToStream(); + break; + } + + // align items relative to head item + for (i=1; i(viewList.ItemAt(i)); + if (pView) { + switch (side) { + case ALIGN_LEFT: + viewLoc.y += alignLen; + MoveViewCorner(*pView, viewLoc, CORNER_TOPLEFT); + break; + case ALIGN_TOP: + viewLoc.x += alignLen; + MoveViewCorner(*pView, viewLoc, CORNER_TOPLEFT); + break; + case ALIGN_RIGHT: + viewLoc.y += alignLen; + MoveViewCorner(*pView, viewLoc, CORNER_TOPRIGHT); + break; + case ALIGN_BOTTOM: + viewLoc.x += alignLen; + MoveViewCorner(*pView, viewLoc, CORNER_BOTTOMLEFT); + break; + case ALIGN_HCENTER: + { + viewLoc.x += alignLen; + BPoint moveLoc = viewLoc; + BRect r = pView->Frame(); + moveLoc.y -= (r.bottom - r.top) / 2; + MoveViewCorner(*pView, moveLoc, CORNER_TOPLEFT); + break; + } + case ALIGN_VCENTER: + { + viewLoc.y += alignLen; + BPoint moveLoc = viewLoc; + BRect r = pView->Frame(); + moveLoc.x -= (r.right - r.left) / 2; + MoveViewCorner(*pView, moveLoc, CORNER_TOPLEFT); + break; + } + } + } + } +} + +void ViewLayoutFactory::ResizeToListMax(BList& viewList, rect_dim resizeDim, + corner anchor) +{ + int32 i, len = viewList.CountItems(); + float maxWidth = 0.0f, maxHeight = 0.0f; + float curWidth = 0.0f, curHeight = 0.0f; + + // find maximum dimensions + for (i=0; i(viewList.ItemAt(i)); + if (pView) { + BRect frame = pView->Frame(); + curWidth = frame.Width(); + curHeight = frame.Height(); + if (curWidth > maxWidth) { + maxWidth = curWidth; + } + if (curHeight > maxHeight) { + maxHeight = curHeight; + } + } + } + + // now resize everything in the list based on selected dimension + for (i=0; i(viewList.ItemAt(i)); + if (pView) { + float newWidth, newHeight; + BRect frame = pView->Frame(); + newWidth = (resizeDim & RECT_WIDTH) + ? maxWidth : frame.Width(); + newHeight = (resizeDim & RECT_HEIGHT) + ? maxHeight : frame.Height(); + pView->ResizeTo(newWidth, newHeight); + } + } +} + +void ViewLayoutFactory::ResizeAroundChildren(BView& view, BPoint margin) +{ + float fMax_x = 0.0f, fMax_y = 0.0f; + int32 numChild = view.CountChildren(); + for (int32 i = 0; i < numChild; i++) + { + BView* childView = view.ChildAt(i); + if (childView) { + BRect r = childView->Frame(); + fMax_x = max(fMax_x, r.right); + fMax_y = max(fMax_y, r.bottom); + } + } + + fMax_x += margin.x; + fMax_y += margin.y; + view.ResizeTo(fMax_x, fMax_y); +} diff --git a/src/tests/kits/interface/menu/menuworld/ViewLayoutFactory.h b/src/tests/kits/interface/menu/menuworld/ViewLayoutFactory.h new file mode 100644 index 0000000000..1e91266155 --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/ViewLayoutFactory.h @@ -0,0 +1,79 @@ +//-------------------------------------------------------------------- +// +// ViewLayoutFactory.h +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#ifndef _ViewLayoutFactory_h +#define _ViewLayoutFactory_h + +#include + +typedef enum { CORNER_TOPLEFT, CORNER_BOTTOMLEFT, + CORNER_TOPRIGHT, CORNER_BOTTOMRIGHT } corner; + +// bit flags +typedef enum { RECT_WIDTH = 1, RECT_HEIGHT, + RECT_WIDTH_AND_HEIGHT } rect_dim; + +typedef enum { ALIGN_LEFT, ALIGN_TOP, ALIGN_RIGHT, + ALIGN_BOTTOM, ALIGN_HCENTER, ALIGN_VCENTER } align_side; + +//==================================================================== +// CLASS: ViewLayoutFactory +// --------------------------- +// A class, still under construction, that handles some +// simple view layout problems. Primarily, it creates +// standard Interface Kit views that are automatically +// set to their preferred size. In addition, it provides: +// +// * Positioning of views using any one of the corners of +// the view's rectangle +// * Alignment of a group of views along one edge or center, +// to a specified distance between views. +// * Adjustment of the width or height of a group of views +// to the maximum value represented by the group. +// * Resizing of a view to surround all of its children, +// plus a specified margin on the right and bottom sides. + +class ViewLayoutFactory +{ + //---------------------------------------------------------------- + // Factory generators + +public: + BButton* MakeButton(const char* name, const char* label, + uint32 msgID, BPoint pos, + corner posRef = CORNER_TOPLEFT); + BCheckBox* MakeCheckBox(const char* name, const char* label, + uint32 msgID, BPoint pos, + corner posRef = CORNER_TOPLEFT); + BTextControl* MakeTextControl(const char* name, const char* label, + const char* text, BPoint pos, float controlWidth, + corner posRef = CORNER_TOPLEFT); + + void LayoutTextControl(BTextControl& control, + BPoint pos, float controlWidth, + corner posRef = CORNER_TOPLEFT); + + //---------------------------------------------------------------- + // Other operations + +public: + void MoveViewCorner(BView& view, BPoint pos, + corner posRef = CORNER_TOPLEFT); + void Align(BList& viewList, align_side side, + float alignLen); + void ResizeToListMax(BList& viewList, rect_dim resizeDim, + corner anchor = CORNER_TOPLEFT); + void ResizeAroundChildren(BView& view, BPoint margin); +}; + +#endif /* _ViewLayoutFactory_h */ \ No newline at end of file diff --git a/src/tests/kits/interface/menu/menuworld/_README.txt b/src/tests/kits/interface/menu/menuworld/_README.txt new file mode 100644 index 0000000000..8d71281d00 --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/_README.txt @@ -0,0 +1,9 @@ +MenuWorld + +This is an application which demostrates customizing menus in the Interface Kit. It ties in with the newsletter article "Mucking With Menus," located at: + +http://www.be.com/aboutbe/benewsletter/volume_II/Issue30.html#Workshop + +See the About box... for directions on using MenuWorld, and the newsletter article for other salient points. + +-- Owen Smith, 29-Jul-98 diff --git a/src/tests/kits/interface/menu/menuworld/constants.cpp b/src/tests/kits/interface/menu/menuworld/constants.cpp new file mode 100644 index 0000000000..f00a95f3cc --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/constants.cpp @@ -0,0 +1,177 @@ +//-------------------------------------------------------------------- +// +// constants.cpp +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#include "constants.h" + +extern const char* STR_APP_SIG + = "application/x-vnd.BeDTS.MenuWorld"; + +#if defined(LOCALE_USA) + +//-------------------------------------------------------------------- +// American English Strings + + +extern const char* STR_APP_NAME + = "MenuWorld"; + +extern const char* STR_IERROR + = "Internal Error:\n"; + +extern const char* STR_SEPARATOR + = "--------------------"; + +extern const char* STR_NO_FULL_MENU_BAR + = "Couldn't find the window's menu bar."; + +extern const char* STR_NO_HIDDEN_MENU_BAR + = "Couldn't find the window's hidden menu bar."; + +extern const char* STR_NO_MENU_VIEW + = "Couldn't find the window's menu view"; + +extern const char* STR_NO_STATUS_VIEW + = "Couldn't find the window's status view"; + +extern const char* STR_NO_LABEL_CTRL + = "Couldn't find the label edit field."; + +extern const char* STR_NO_HIDE_USER_CHECK + = "Couldn't find the hide user menus check box."; + +extern const char* STR_NO_LARGE_ICON_CHECK + = "Couldn't find the large test icons check box."; + +extern const char* STR_NO_ADDMENU_BUTTON + = "Couldn't find the add menu button."; + +extern const char* STR_NO_ADDITEM_BUTTON + = "Couldn't find the add menu item button."; + +extern const char* STR_NO_DELETE_BUTTON + = "Couldn't find the delete button."; + +extern const char* STR_NO_MENU_OUTLINE + = "Couldn't find the menu outline list."; + +extern const char* STR_NO_MENU_SCROLL_VIEW + = "Couldn't find the menu outline list scroll view."; + +extern const char* STR_MNU_FILE + = "File"; + +extern const char* STR_MNU_FILE_ABOUT + = "About..."; + +extern const char* STR_MNU_FILE_CLOSE + = "Close"; + +extern const char* STR_MNU_TEST + = "Test"; + +extern const char* STR_MNU_TEST_ITEM + = "Test Item"; + +extern const char* STR_MNU_EMPTY_ITEM + = "(Empty menu)"; + +extern const char* STR_LABEL_CTRL + = "Label:"; + +extern const char* STR_HIDE_USER_MENUS + = "Hide User Menus"; + +extern const char* STR_LARGE_TEST_ICONS + = "Large Test Icons"; + +extern const char* STR_ADD_MENU + = "Add Menu"; + +extern const char* STR_ADD_ITEM + = "Add Item"; + +extern const char* STR_ADD_SEP + = "Add Separator"; + +extern const char* STR_DELETE_MENU + = "Delete"; + +extern const char* STR_STATUS_DEFAULT + = ""; + +extern const char* STR_STATUS_TEST + = "Test item selected: "; + +extern const char* STR_STATUS_USER + = "Menu item selected: "; + +extern const char* STR_STATUS_ADD_MENU + = "Added menu: "; + +extern const char* STR_STATUS_ADD_ITEM + = "Added menu item: "; + +extern const char* STR_STATUS_ADD_SEPARATOR + = "Added separator menu item"; + +extern const char* STR_STATUS_DELETE_MENU + = "Deleted menu: "; + +extern const char* STR_STATUS_DELETE_ITEM + = "Deleted menu item: "; + +extern const char* STR_STATUS_DELETE_SEPARATOR + = "Deleted separator menu item"; + +extern const char* STR_ABOUT_TITLE + = "About MenuWorld"; + +extern const char* STR_ABOUT_BUTTON + = "Struth!"; + +extern const char* STR_ABOUT_DESC + = "MenuWorld: a menu editing example\n\n" + "How to use:\n" + " Type some text into the label field, and " + "press \"Add Menu\" to add a menu.\n" + " Select an item in the outline list, and " + "press \"Delete\" to remove it.\n" + " Select an item in the outline list, type " + "some text into the label field, and press " + "\"Add Item\" to add an item under the selected " + "item. If nothing besides spaces or dashes is " + "typed in, a separator item will be created.\n" + " \"Hide User Menus\" hides the menus you've " + "generated.\n" + " \"Large Test Icons\" changes the size of " + "the numbers in the Test menu."; + +#endif /* LOCALE_USA */ + + + +//-------------------------------------------------------------------- +// Shortcuts + +extern const char CMD_FILE_CLOSE + = 'W'; + +extern const char CMD_TEST_ICON_SIZE + = 'I'; + + + +//-------------------------------------------------------------------- +// Colors + +extern const rgb_color BKG_GREY = { 216, 216, 216, 0 }; diff --git a/src/tests/kits/interface/menu/menuworld/constants.h b/src/tests/kits/interface/menu/menuworld/constants.h new file mode 100644 index 0000000000..5b8e1d6488 --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/constants.h @@ -0,0 +1,97 @@ +//-------------------------------------------------------------------- +// +// constants.h +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#ifndef _constants_h +#define _constants_h + +#include + +//-------------------------------------------------------------------- +// Message IDs + +const int32 MSG_WIN_ADD_MENU = 'oWAM'; +const int32 MSG_WIN_DELETE_MENU = 'oWDM'; +const int32 MSG_VIEW_ADD_MENU = 'oVAM'; +const int32 MSG_VIEW_DELETE_MENU = 'oVDM'; +const int32 MSG_VIEW_ADD_ITEM = 'oVAI'; +const int32 MSG_WIN_HIDE_USER_MENUS = 'oWHU'; +const int32 MSG_WIN_LARGE_TEST_ICONS = 'oWFM'; +const int32 MSG_MENU_OUTLINE_SEL = 'oSMU'; +const int32 MSG_TEST_ITEM = 'oWTM'; +const int32 MSG_USER_ITEM = 'oWUM'; +const int32 MSG_LABEL_EDIT = 'oLED'; + + +//-------------------------------------------------------------------- +// Strings + +extern const char* STR_APP_SIG; + +// Simple localization scheme +#define LOCALE_USA + +extern const char* STR_APP_NAME; +extern const char* STR_IERROR; +extern const char* STR_SEPARATOR; +extern const char* STR_NO_FULL_MENU_BAR; +extern const char* STR_NO_HIDDEN_MENU_BAR; +extern const char* STR_NO_MENU_VIEW; +extern const char* STR_NO_STATUS_VIEW; +extern const char* STR_NO_LABEL_CTRL; +extern const char* STR_NO_HIDE_USER_CHECK; +extern const char* STR_NO_LARGE_ICON_CHECK; +extern const char* STR_NO_ADDMENU_BUTTON; +extern const char* STR_NO_ADDITEM_BUTTON; +extern const char* STR_NO_DELETE_BUTTON; +extern const char* STR_NO_MENU_OUTLINE; +extern const char* STR_NO_MENU_SCROLL_VIEW; +extern const char* STR_MNU_FILE; +extern const char* STR_MNU_FILE_ABOUT; +extern const char* STR_MNU_FILE_CLOSE; +extern const char* STR_MNU_TEST; +extern const char* STR_MNU_TEST_ITEM; +extern const char* STR_MNU_EMPTY_ITEM; +extern const char* STR_LABEL_CTRL; +extern const char* STR_HIDE_USER_MENUS; +extern const char* STR_LARGE_TEST_ICONS; +extern const char* STR_ADD_MENU; +extern const char* STR_ADD_ITEM; +extern const char* STR_ADD_SEP; +extern const char* STR_DELETE_MENU; +extern const char* STR_STATUS_DEFAULT; +extern const char* STR_STATUS_TEST; +extern const char* STR_STATUS_USER; +extern const char* STR_STATUS_ADD_MENU; +extern const char* STR_STATUS_ADD_ITEM; +extern const char* STR_STATUS_ADD_SEPARATOR; +extern const char* STR_STATUS_DELETE_SEPARATOR; +extern const char* STR_STATUS_DELETE_MENU; +extern const char* STR_STATUS_DELETE_ITEM; +extern const char* STR_ABOUT_TITLE; +extern const char* STR_ABOUT_BUTTON; +extern const char* STR_ABOUT_DESC; + + +//-------------------------------------------------------------------- +// Shortcuts + +extern const char CMD_FILE_CLOSE; +extern const char CMD_TEST_ICON_SIZE; + + +//-------------------------------------------------------------------- +// Colors + +extern const rgb_color BKG_GREY; + +#endif /* _constants_h */ \ No newline at end of file diff --git a/src/tests/kits/interface/menu/menuworld/main.cpp b/src/tests/kits/interface/menu/menuworld/main.cpp new file mode 100644 index 0000000000..400cb269d8 --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/main.cpp @@ -0,0 +1,23 @@ +//-------------------------------------------------------------------- +// +// main.cpp +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#include "MenuApp.h" + +int main(void) +{ + MenuApp app; + app.Run(); + return B_NO_ERROR; +} + + diff --git a/src/tests/kits/interface/menu/menuworld/stddlg.cpp b/src/tests/kits/interface/menu/menuworld/stddlg.cpp new file mode 100644 index 0000000000..f1a745f347 --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/stddlg.cpp @@ -0,0 +1,29 @@ +//-------------------------------------------------------------------- +// +// stddlg.cpp +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#include +#include + +#include "constants.h" +#include "stddlg.h" + +void ierror(const char* msg) +{ + char* fullMsg = new char[strlen(STR_IERROR) + strlen(msg) + 1]; + strcpy(fullMsg, STR_IERROR); + strcpy(fullMsg, msg); + BAlert alert("Internal Error", fullMsg, "OK", NULL, NULL, + B_WIDTH_AS_USUAL, B_STOP_ALERT); + alert.Go(); + delete [] fullMsg; +} diff --git a/src/tests/kits/interface/menu/menuworld/stddlg.h b/src/tests/kits/interface/menu/menuworld/stddlg.h new file mode 100644 index 0000000000..f57e065710 --- /dev/null +++ b/src/tests/kits/interface/menu/menuworld/stddlg.h @@ -0,0 +1,19 @@ +//-------------------------------------------------------------------- +// +// stddlg.h +// +// Written by: Owen Smith +// +//-------------------------------------------------------------------- + +/* + Copyright 1999, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ + +#ifndef _stddlg_h +#define _stddlg_h + +void ierror(const char* msg); + +#endif /* _stddlg_h */ \ No newline at end of file