Exemple #1
0
void OpDisplayTEMPLATEGallery::Do(OpDescriptor*)
{
	DialogBarOp *pDialogBarOp = FindGallery();

	if (pDialogBarOp != NULL)
	{
		// Toggle the visible state of the gallery window
		pDialogBarOp->SetVisibility( !pDialogBarOp->IsVisible() );

		// And update the gallery button state
		SGInit::UpdateGalleryButton(OPTOKEN_DISPLAYTEMPLATEGALLERY, pDialogBarOp->IsVisible());
	}
	
	End();
}
Exemple #2
0
void OpDisplayColourGallery::Do(OpDescriptor*)
{
	String_32 Name(_R(IDS_K_COLGAL_GALLNAME));
	DialogBarOp* pDialogBarOp = DialogBarOp::FindDialogBarOp(Name);

	if (pDialogBarOp != NULL)
	{
		if (pDialogBarOp->GetRuntimeClass() == CC_RUNTIME_CLASS(ColourSGallery))
		{
			// Toggle the visibility of the gallery window
			pDialogBarOp->SetVisibility( !pDialogBarOp->IsVisible() );
		}
#if _DEBUG
		else
			ERROR3("The Colour Gallery isn't a ColourSGallery! Woss goin' on?");
#endif

		SGInit::UpdateGalleryButton(OPTOKEN_DISPLAYCOLOURGALLERY, pDialogBarOp->IsVisible());
	}

	ERROR3IF(pDialogBarOp == NULL,"Couldn't find the colour gallery bar");

	End();
}
Exemple #3
0
void ToolbarDlg::TakeToolbarDetails()
{
	EnableGadget(_R(IDC_DELETEBAR), CanDeleteSelection());

	CMainFrame* pFrame = GetMainFrame();

	BOOL	check;
	BOOL	VV;

	check = (BOOL)GetLongGadgetValue(_R(IDC_BIGTOP),0,1,_R(IDS_PHILS_EXAMPLE),&VV);
	pFrame->GetDockBar(DOCKBAR_TOP)->SetBigControlState(check);

	check = (BOOL)GetLongGadgetValue(_R(IDC_BIGLEFT),0,1,_R(IDS_PHILS_EXAMPLE),&VV);
	pFrame->GetDockBar(DOCKBAR_LEFT)->SetBigControlState(check);

	check = (BOOL)GetLongGadgetValue(_R(IDC_BIGRIGHT),0,1,_R(IDS_PHILS_EXAMPLE),&VV);
	pFrame->GetDockBar(DOCKBAR_RIGHT)->SetBigControlState(check);

	check = (BOOL)GetLongGadgetValue(_R(IDC_BIGBOTTOM),0,1,_R(IDS_PHILS_EXAMPLE),&VV);
	pFrame->GetDockBar(DOCKBAR_BOTTOM)->SetBigControlState(check);

	check = (BOOL)GetLongGadgetValue(_R(IDC_BIGFLOAT),0,1,_R(IDS_PHILS_EXAMPLE),&VV);
	pFrame->GetDockBar(DOCKBAR_FLOAT)->SetBigControlState(check);


	CCustomList* pListGadget = CCustomList::GetGadget(GetReadWriteWindowID(), _R(IDC_BARLIST));
	if (pListGadget == NULL)
		return;
	
	// Adjust the visibility of the bars...
	INT32 listitem = 0;
	INT32 listcount = pListGadget->GetItemCount();
	String_32 BarName;
		
	// variables control the dynamic relocation of the 'floating' toolbar ....
//	INT32 ToolbarIndex = -1;
//	BOOL BeenHidden = FALSE;
//	BOOL ToolbarCurrentState = FALSE;
	
	while (listitem < listcount)
	{
		// Find bar by name...
		pListGadget->GetItemString(BarName, listitem, 1);

		// If name is "Infobar" deal with it specially...
		if (BarName == InfoBarName)
			InformationBarOp::SetVisibility(pListGadget->GetSwitchState(listitem, 0));
		else if (BarName == String_32 (TEXT ("Toolbar")))
		{
			// do special stuff now ....

			DialogBarOp* pBar = DialogBarOp::FindDialogBarOp(BarName);
			ERROR3IF(pBar == NULL, "Cannot find named bar in TakeToolbarDetails");

			// If bar is of correct type then adjust its visibility according to the
			// check mark...
			if (!pBar->IsKindOf(CC_RUNTIME_CLASS(SystemBarOp)) ||
				!pBar->IsKindOf(CC_RUNTIME_CLASS(InformationBarOp)) )
			{
				//ToolbarIndex = listitem;
				
				BOOL CurrentState = pBar->IsVisible ();
				//ToolbarCurrentState = CurrentState;
				pBar->SetVisibility(pListGadget->GetSwitchState(listitem, 0));

				if (pListGadget->GetSwitchState(listitem, 0) != CurrentState)
				{	
					if (pListGadget->GetSwitchState(listitem, 0))
					{
						GetMainFrame ()->SetToolbarCreated (TRUE);
						GetMainFrame ()->RelocateToolbar ();
					}
					else
					{
						// so that we can lock out the toolbar 'onmove' and 'onsize' code
						// from being executed when there is no toolbar
						GetMainFrame ()->SetToolbarCreated (FALSE);
					}
				}
			//	else
			//	{
			//		BeenHidden = TRUE;
			//	}
			}
		}
		else
		{
			// Look for the named bar in the barops list...
			DialogBarOp* pBar = DialogBarOp::FindDialogBarOp(BarName);
			ERROR3IF(pBar == NULL, "Cannot find named bar in TakeToolbarDetails");

			// If bar is of correct type then adjust its visibility according to the
			// check mark...
			if (!pBar->IsKindOf(CC_RUNTIME_CLASS(SystemBarOp)) ||
				!pBar->IsKindOf(CC_RUNTIME_CLASS(InformationBarOp)) )
			{
				pBar->SetVisibility(pListGadget->GetSwitchState(listitem, 0));
			}
		}

		listitem++;
	}

	// dynamically reposition the toolbar when the above options are changed ....
	
/*	if ((ToolbarIndex != -1) && (!BeenHidden))
	{
		if (pListGadget->GetSwitchState(ToolbarIndex, 0) != ToolbarCurrentState)
		if (pListGadget->GetSwitchState(ToolbarIndex, 0))
		{
			GetMainFrame ()->SetToolbarCreated (TRUE);
			GetMainFrame ()->RelocateToolbar ();
		}
	}*/
}