Exemplo n.º 1
0
void
TBarView::_ChangeState(BMessage* message)
{
	int32 state = message->FindInt32("state");
	bool vertical = message->FindBool("vertical");
	bool left = message->FindBool("left");
	bool top = message->FindBool("top");

	bool vertSwap = (fVertical != vertical);
	bool leftSwap = (fLeft != left);
	bool stateChanged = (fState != state);

	fState = state;
	fVertical = vertical;
	fLeft = left;
	fTop = top;

	// Send a message to the preferences window to let it know to enable
	// or disable preference items
	if (stateChanged || vertSwap)
		be_app->PostMessage(kStateChanged);

	PlaceDeskbarMenu();
	PlaceTray(vertSwap, leftSwap);
	PlaceApplicationBar();
}
Exemplo n.º 2
0
void
TBarView::_ChangeState(BMessage* message)
{
	int32 state = message->FindInt32("state");
	bool vertical = message->FindBool("vertical");
	bool left = message->FindBool("left");
	bool top = message->FindBool("top");

	bool vertSwap = (fVertical != vertical);
	bool leftSwap = (fLeft != left);
	bool stateChanged = (fState != state);

	fState = state;
	fVertical = vertical;
	fLeft = left;
	fTop = top;

	SaveExpandedItems();

	if (stateChanged || vertSwap) {
		be_app->PostMessage(kStateChanged);
			// Send a message to the preferences window to let it know to
			// enable or disable preference items.

		// If switching to expando state, rebuild expando menu bar.
		if (fState == kExpandoState) {
			if (fInlineScrollView != NULL) {
				fInlineScrollView->DetachScrollers();
				fInlineScrollView->RemoveSelf();
				delete fInlineScrollView;
				fInlineScrollView = NULL;
			}
			if (fExpandoMenuBar != NULL) {
				delete fExpandoMenuBar;
				fExpandoMenuBar = NULL;
			}

			fExpandoMenuBar = new TExpandoMenuBar(BRect(0, 0, 0, 0),
				"ExpandoMenuBar", this, fVertical);
			fInlineScrollView = new TInlineScrollView(BRect(0, 0, 0, 0),
				fExpandoMenuBar, fVertical ? B_VERTICAL : B_HORIZONTAL);
			AddChild(fInlineScrollView);
		}
	}

	PlaceDeskbarMenu();
	PlaceTray(vertSwap, leftSwap);
	PlaceApplicationBar();
}
Exemplo n.º 3
0
void
TBarView::_ChangeState(BMessage* message)
{
	int32 state = message->FindInt32("state");
	bool vertical = message->FindBool("vertical");
	bool left = message->FindBool("left");
	bool top = message->FindBool("top");

	bool vertSwap = (fVertical != vertical);
	bool leftSwap = (fLeft != left);
	bool stateChanged = (fState != state);

	fState = state;
	fVertical = vertical;
	fLeft = left;
	fTop = top;

	if (stateChanged || vertSwap) {
		be_app->PostMessage(kStateChanged);
			// Send a message to the preferences window to let it know to
			// enable or disable preference items.

		if (vertSwap && fExpandoMenuBar != NULL) {
			if (fVertical) {
				fInlineScrollView->SetOrientation(B_VERTICAL);
				fExpandoMenuBar->SetMenuLayout(B_ITEMS_IN_COLUMN);
				fExpandoMenuBar->StartMonitoringWindows();
			} else {
				fInlineScrollView->SetOrientation(B_HORIZONTAL);
				fExpandoMenuBar->SetMenuLayout(B_ITEMS_IN_ROW);
				fExpandoMenuBar->StopMonitoringWindows();
			}
		}
	}

	PlaceDeskbarMenu();
	PlaceTray(vertSwap, leftSwap);
	PlaceApplicationBar();
}