Example #1
0
void SetHistoryButtonStates( void )
{
	// this function will look at what page we are viewing, enable and disable buttons as needed
  
	if( iCurrentHistoryPage == 1 )
	{
		// first page, disable left buttons
		DisableButton( 	giHistoryButton[PREV_PAGE_BUTTON] );
	  
	}
	else
	{
		// enable buttons
		EnableButton( giHistoryButton[PREV_PAGE_BUTTON] );
	  
	}

	if( IncrementCurrentPageHistoryDisplay( ) )
	{
		// decrement page
    iCurrentHistoryPage--;
		DrawAPageofHistoryRecords( );
    
		// enable buttons
		EnableButton( giHistoryButton[ NEXT_PAGE_BUTTON ] );

	}
	else
	{
    DisableButton( 	giHistoryButton[ NEXT_PAGE_BUTTON ] );
	}
}
void EnableDisableTimeCompressButtons( void )
{
	if( AllowedToTimeCompress( ) == FALSE )
	{
		DisableButton( guiMapBottomTimeButtons[ MAP_TIME_COMPRESS_MORE ] );
		DisableButton( guiMapBottomTimeButtons[ MAP_TIME_COMPRESS_LESS ] );
	}
	else
	{
		// disable LESS if time compression is at minimum or OFF
		if ( !IsTimeCompressionOn() || giTimeCompressMode == TIME_COMPRESS_X0 )
		{
			DisableButton( guiMapBottomTimeButtons[ MAP_TIME_COMPRESS_LESS ] );
		}
		else
		{
			EnableButton( guiMapBottomTimeButtons[ MAP_TIME_COMPRESS_LESS] );
		}

		// disable MORE if we're not paused and time compression is at maximum
		// only disable MORE if we're not paused and time compression is at maximum
		if ( IsTimeCompressionOn() && ( giTimeCompressMode == TIME_COMPRESS_60MINS ) )
		{
			DisableButton( guiMapBottomTimeButtons[ MAP_TIME_COMPRESS_MORE ] );
		}
		else
		{
			EnableButton( guiMapBottomTimeButtons[ MAP_TIME_COMPRESS_MORE ] );
		}
	}
}
Example #3
0
void CChuquanData::OnChangeStockSymbol() 
{

	CString strStockCode;
	GetDlgItem(1008)->GetWindowText(strStockCode);         


	if(strStockCode.GetLength()==4||strStockCode.GetLength()==6)
	{

		CReportData *Cdat=NULL;
		if(m_ctrlChuQuan.GetItemCount()>0)
			m_ctrlChuQuan.DeleteAllItems();
		if(pDoc->m_sharesInformation.Lookup(strStockCode.GetBuffer(0),Cdat,m_nKind))
		{

			EnableButton(TRUE);

			CString sName=Cdat->name;
			GetDlgItem(IDC_STANAME)->SetWindowText(sName);


			Split *pSplit=NULL;

			int nTotleTimes=GetChuQuanInfo(strStockCode.GetBuffer(0),pSplit);
			if((nTotleTimes>0)&&(pSplit!=NULL))
			{
				POWER Power;
				for(int i=0;i<nTotleTimes;i++)
				{
					CTime time=pSplit[i].nTime;
					CString szTime=time.Format("%Y/%m/%d");

					Power.fAllocate=pSplit[i].Allocate;
					Power.fAllocatePrice=pSplit[i].AllocatePrice;
					Power.fDividend=pSplit[i].Bonus;
					Power.fGive=pSplit[i].Give;
					Power.nFlags=pSplit[i].nFlags;
					Power.nTime=pSplit[i].nTime;
					InsertItem(i,szTime,Power);
					m_nChuQuanKind[i]=Power.nFlags;
				}
			}		
		}
	}
	else 
	{

		GetDlgItem(IDC_STANAME)->SetWindowText("");

		if(m_ctrlChuQuan.GetItemCount()>0)
		{
			m_ctrlChuQuan.DeleteAllItems( );
			for(int i=0;i<80;i++)
				m_nChuQuanKind[i]=0;
		}
		EnableButton(FALSE);
	}

}
Example #4
0
void DisableArrowButtonsIfOnLastOrFirstPage()
{
	if( gubCurrentInsInfoSubPage == INS_INFO_INFO_TOC) 
		DisableButton( guiInsPrevBackButton);
	else
		EnableButton( guiInsPrevBackButton );

	if( gubCurrentInsInfoSubPage == INS_INFO_LAST_PAGE - 1 ) 
		DisableButton( guiInsNextBackButton);
	else
		EnableButton( guiInsNextBackButton );
}
Example #5
0
void EnableDisableChatLogScrollButtonsAndRegions( void )
{
	UINT8 ubNumMessages;

	ubNumMessages = GetRangeOfChatLogMessages();

	// if no scrolling required, or already showing the topmost message
	if( ( ubNumMessages <= MAX_CHATLOG_MESSAGES ) || ( gubFirstChatLogMessageIndex == 0 ) )
	{
		DisableButton( guiChatLogScrollButtons[ CHAT_SCROLL_MESSAGE_UP ] );
		ButtonList[ guiChatLogScrollButtons[ CHAT_SCROLL_MESSAGE_UP ] ]->uiFlags &= ~( BUTTON_CLICKED_ON );
	}
	else
	{
		EnableButton( guiChatLogScrollButtons[ CHAT_SCROLL_MESSAGE_UP ] );
	}

	// if no scrolling required, or already showing the last message
	if( ( ubNumMessages <= MAX_CHATLOG_MESSAGES ) ||
			( ( gubFirstChatLogMessageIndex + MAX_CHATLOG_MESSAGES ) >= ubNumMessages ) )
	{
		DisableButton( guiChatLogScrollButtons[ CHAT_SCROLL_MESSAGE_DOWN ] );
		ButtonList[ guiChatLogScrollButtons[ CHAT_SCROLL_MESSAGE_DOWN ] ]->uiFlags &= ~( BUTTON_CLICKED_ON );
	}
	else
	{
		EnableButton( guiChatLogScrollButtons[ CHAT_SCROLL_MESSAGE_DOWN ] );
	}

	if( ubNumMessages <= MAX_CHATLOG_MESSAGES )
	{
		MSYS_DisableRegion( &gChatLogScrollBarRegion );
	}
	else
	{
		MSYS_EnableRegion( &gChatLogScrollBarRegion );
	}

	if (cGameType==MP_TYPE_TEAMDEATMATCH)
	{
		// Only enable Allies toggle for team deathmatch
		EnableButton( guiChatToggles[1] );
	}
	else
	{
		gbChatSendToAll = true;
		DisableButton( guiChatToggles[1] );
	}
}
Example #6
0
BOOL CCmdDlg::OnInitDialog()
{
	CString strTitle;
	CLIENT_INFO info;

	BOOL ret = GetClientInfo(m_clientid,&info);

	if (ret )
	{
		IN_ADDR connectIP;
		connectIP.S_un.S_addr = info.connectIP;

		strTitle.Format(_T("Commander [%s][%s]"),info.computerName,CString(inet_ntoa(connectIP)).GetBuffer());

		SetWindowText(strTitle);
	}

	__super::OnInitDialog();

	InitDisable();
	m_bkBrush.CreateSolidBrush(RGB(0,0,0));


	InitResize();

	EnableButton(FALSE);

	

	return TRUE;
}
Example #7
0
BOOLEAN InitFlowerButtons()
{
	UINT16 i,j, count;
	UINT16 usPosY;
	char		sTemp[40];
	VOBJECT_DESC	VObjectDesc;


	if( (FLOR_GALLERY_NUMBER_FLORAL_IMAGES - gubCurFlowerIndex) >= 3 )
		gubCurNumberOfFlowers = 3;
	else
		gubCurNumberOfFlowers = FLOR_GALLERY_NUMBER_FLORAL_IMAGES - gubCurFlowerIndex;

	gubPrevNumberOfFlowers = gubCurNumberOfFlowers;

	//the 10 pictures of the flowers
	count = gubCurFlowerIndex;
	for(i=0; i<gubCurNumberOfFlowers; i++)
	{
		// load the handbullet graphic and add it
		sprintf( sTemp, "LAPTOP\\Flower_%d.sti", count);
		VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
		FilenameForBPP(sTemp, VObjectDesc.ImageFile);
		CHECKF(AddVideoObject(&VObjectDesc, &guiFlowerImages[i]));
		count++;
	}

	//the buttons with the flower pictures on them
	usPosY = FLOR_GALLERY_FLOWER_BUTTON_Y;
//	usPosX = FLOR_GALLERY_FLOWER_BUTTON_X;
	count = gubCurFlowerIndex;
	guiGalleryButtonImage	= LoadButtonImage("LAPTOP\\GalleryButtons.sti", -1,0,-1,1,-1 );
	for(j=0; j<gubCurNumberOfFlowers; j++)
	{
		guiGalleryButton[j] = QuickCreateButton( guiGalleryButtonImage, FLOR_GALLERY_FLOWER_BUTTON_X, usPosY,
																	BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
																	DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)BtnGalleryFlowerButtonCallback);
		SetButtonCursor( guiGalleryButton[j], CURSOR_WWW);
		MSYS_SetBtnUserData( guiGalleryButton[j], 0, count);

		SpecifyButtonIcon( guiGalleryButton[j], guiFlowerImages[ j ], 0, 5, 5, FALSE );
		usPosY += FLOR_GALLERY_FLOWER_BUTTON_OFFSET_Y;
		count ++;
	}

	//if its the first page, display the 'back' text	in place of the 'prev' text on the top left button
	if( gubCurFlowerIndex == 0 )
		SpecifyButtonText( guiFloralGalleryButton[0], sFloristGalleryText[FLORIST_GALLERY_HOME] );
	else
		SpecifyButtonText( guiFloralGalleryButton[0], sFloristGalleryText[FLORIST_GALLERY_PREV] );

	//if it is the last page disable the next button
	if( gubCurFlowerIndex == FLOR_GALLERY_NUMBER_FLORAL_IMAGES-1 )
		DisableButton( guiFloralGalleryButton[1] );
	else
		EnableButton( guiFloralGalleryButton[1] );


	return(TRUE);
}
void MoveBackAQuestion( void )
{
	if( giCurrentPersonalityQuizQuestion > 0 )
	{
		giCurrentPersonalityQuizQuestion--;

		iCurrentAnswer = -1;
		CheckStateOfTheConfirmButton( );

		iCurrentAnswer = iQuizAnswerList[ giCurrentPersonalityQuizQuestion ];
	}

	EnableButton( giNextQuestionButton );

	CheckAndUpdateNextPreviousIMPQuestionButtonStates( );

//	if( giCurrentPersonalityQuizQuestion == 0 )
//	{
//		DisableButton( giPreviousQuestionButton );
//	}
//	else
//	{
//		EnableButton( giPreviousQuestionButton );
//	}

	return;
}
Example #9
0
void CGUIDialogSelect::OnInitWindow()
{
  m_viewControl.SetItems(*m_vecList);
  m_selectedItems->Clear();
  if (m_iSelected == -1)
  {
    for(int i = 0 ; i < m_vecList->Size(); i++)
    {
      if (m_vecList->Get(i)->IsSelected())
      {
        m_iSelected = i;
        break;
      }
    }
  }
  m_viewControl.SetCurrentView(m_useDetails ? CONTROL_DETAILS : CONTROL_LIST);

  CStdString items;
  items.Format("%i %s", m_vecList->Size(), g_localizeStrings.Get(127).c_str());
  SET_CONTROL_LABEL(CONTROL_NUMBEROFFILES, items);
  
  if (m_multiSelection)
    EnableButton(true, 186);

  SetupButton();
  CGUIDialogBoxBase::OnInitWindow();

  // if m_iSelected < 0 focus first item
  m_viewControl.SetSelectedItem(std::max(m_iSelected, 0));
}
Example #10
0
void CAclApp::Delete()
{
	if((m_bButtonFlags & ACL_BUTTON_DEL_MASK) != ACL_BUTTON_DEL_MASK) return;

	if(m_iListIndex < 0)
		return;
	
	int tmpIndex;
//	do
//	{
//		m_iListIndex = m_List.GetNextItem(-1, LVNI_SELECTED);
		tmpIndex = m_iListIndex;
//		if(m_iListIndex == -1) break;

		XACL Acl;
		Acl.ulAclID = atol(m_List.GetItemText(m_iListIndex, 0));

		m_bButtonFlags |= ACL_BUTTON_SHOW_APPLY_GROUP;
		SendMessageEx(m_bButtonFlags);

		m_History.AddHistory(OPT_TYPE_DELETE, m_bButtonFlags, (char*)&Acl);

		m_List.DeleteItem(m_iListIndex);

//	}while(true);

	if(m_List.GetItemCount() <= 0) EnableButton(FALSE);

	if(tmpIndex == m_List.GetItemCount())	
		tmpIndex -- ;
	m_List.SetItemState(tmpIndex, LVIS_SELECTED, LVIS_SELECTED);
}
void SecurityPasswordDialog::OnChange(OpWidget *widget, BOOL changed_by_mouse)
{

	// if we add a new password, make sure to inform the user about required quality of password
	if (m_callback && m_callback->GetMode() == OpSSLListener::SSLSecurityPasswordCallback::NewPassword)
	{
		OpString newpassword;
		OpString confirmpassword;

		GetWidgetText("Password_edit", newpassword);
		GetWidgetText("Confirm_password_edit", confirmpassword);

		m_ok_enabled = newpassword.Compare(confirmpassword) == 0 && ChangeMasterPasswordDialog::CheckPasswordPolicy(&confirmpassword);
		EnableButton(0, m_ok_enabled);

		if(ChangeMasterPasswordDialog::CheckPasswordPolicy(&newpassword))
		{
			SetWidgetText("Password_info_label",Str::SI_MSG_SECURE_ASK_NEW_PASSWORD_AGAIN);	
		}
		else
		{
			SetWidgetText("Password_info_label", Str::SI_MSG_SECURE_ASK_UPDATE_PASSWORD);		
		}
	}

	Dialog::OnChange(widget, changed_by_mouse);
}
Example #12
0
LRESULT CAclSub::OnSubNotify(UINT wParam, LONG lParam)
{
	BYTE bFlags = (BYTE)lParam;
	EnableButton(bFlags);

	return 0;
}
Example #13
0
void wxRibbonButtonBar::UpdateWindowUI(long flags)
{
    wxWindowBase::UpdateWindowUI(flags);

    // don't waste time updating state of tools in a hidden toolbar
    if ( !IsShown() )
        return;

    size_t btn_count = m_buttons.size();
    bool rerealize = false;
    for ( size_t btn_i = 0; btn_i < btn_count; ++btn_i )
    {
        wxRibbonButtonBarButtonBase& btn = *m_buttons.Item(btn_i);
        int id = btn.id;

        wxUpdateUIEvent event(id);
        event.SetEventObject(this);

        if ( ProcessWindowEvent(event) )
        {
            if ( event.GetSetEnabled() )
                EnableButton(id, event.GetEnabled());
            if ( event.GetSetChecked() )
                ToggleButton(id, event.GetChecked());
            if ( event.GetSetText() )
            {
                btn.label = event.GetText();
                rerealize = true;
            }
        }
    }

    if ( rerealize )
        Realize();
}
Example #14
0
void CAclWeb::Delete()
{
	if((m_bButtonFlags & ACL_BUTTON_DEL_MASK) != ACL_BUTTON_DEL_MASK) return;

	if(m_iListIndex < 0)
		return;

	int tmpIndex = m_iListIndex;

	XACL_WEB Acl;
	Acl.dwId = atol(m_List.GetItemText(m_iListIndex, 0));

	m_bButtonFlags |= ACL_BUTTON_SHOW_APPLY_GROUP;
	SendMessageEx(m_bButtonFlags);

	m_History.AddHistory(OPT_TYPE_DELETE, m_bButtonFlags, (char*)&Acl);

	m_List.DeleteItem(m_iListIndex);
	if(m_List.GetItemCount() <= 0)
	{
		EnableButton(FALSE);
		return;
	}

	if(tmpIndex == m_List.GetItemCount())	
		tmpIndex -- ;

	m_List.SetItemState(tmpIndex, LVIS_SELECTED, LVIS_SELECTED);
}
Example #15
0
void CAclNet::Delete()
{
	if((m_bButtonFlags & ACL_BUTTON_DEL_MASK) != ACL_BUTTON_DEL_MASK) return;
	if(m_iListIndex < 0)
		return;

	int tmpIndex = m_iListIndex;

	m_bButtonFlags |= ACL_BUTTON_SHOW_APPLY_GROUP;
	SendMessageEx(m_bButtonFlags);

	m_History[m_iTreeIndex].AddHistory(OPT_TYPE_DELETE, m_bButtonFlags, (char*)&m_arIp[m_iTreeIndex][m_iListIndex]);

	m_arIp[m_iTreeIndex].RemoveAt(m_iListIndex);
	m_List.DeleteItem(m_iListIndex);
	if(m_List.GetItemCount() <= 0)
	{
		EnableButton(FALSE);
		return;
	}

	if(tmpIndex == m_List.GetItemCount())	
		tmpIndex -- ;

	m_List.SetItemState(tmpIndex, LVIS_SELECTED, LVIS_SELECTED);
}
Example #16
0
BOOL CChuquanData::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();

	CRect Rect;
	LVCOLUMN listColumn;
	char* arColumn[5] = { "除权日期", "送股", "配股", "配股价", "分红" };
	listColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
	listColumn.fmt = LVCFMT_CENTER;
	listColumn.cx = 76;
	for (int nColumn = 0; nColumn < 5; nColumn++)
	{
		listColumn.iSubItem = nColumn;
		listColumn.pszText = arColumn[nColumn];

		m_ctrlChuQuan.InsertColumn(nColumn, &listColumn);
	}

	ListView_SetExtendedListViewStyle( m_ctrlChuQuan.m_hWnd, LVS_EX_FULLROWSELECT);

	EnableButton(FALSE);

	for (int i = 0; i < 80; i++)
		m_nChuQuanKind[i] = 0;

	return TRUE;  
}
Example #17
0
void CGUIDialogSelect::OnInitWindow()
{
  m_viewControl.SetItems(*m_vecList);
  m_selectedItems.clear();
  for(int i = 0 ; i < m_vecList->Size(); i++)
  {
    auto item = m_vecList->Get(i);
    if (item->IsSelected())
    {
      m_selectedItems.push_back(i);
      if (m_selectedItem == nullptr)
        m_selectedItem = item;
    }
  }
  m_viewControl.SetCurrentView(m_useDetails ? CONTROL_DETAILS : CONTROL_LIST);

  std::string items = StringUtils::Format("%i %s", m_vecList->Size(), g_localizeStrings.Get(127).c_str());
  SET_CONTROL_LABEL(CONTROL_NUMBEROFFILES, items);
  
  if (m_multiSelection)
    EnableButton(true, 186);

  SetupButton();
  CGUIDialogBoxBase::OnInitWindow();

  // if nothing is selected, focus first item
  m_viewControl.SetSelectedItem(std::max(GetSelectedLabel(), 0));
}
Example #18
0
void CAclSub::EnableButtonCase(BYTE bSelectButton)
{
	BYTE bFlags;
	switch(bSelectButton)
	{
	case ACL_BUTTON_APP:
		bFlags = m_AclApp.GetButtonFlags();
		break;
	case ACL_BUTTON_WEB:
		bFlags = m_AclWeb.GetButtonFlags();
		break;
	case ACL_BUTTON_NNB:
		bFlags = m_AclNnb.GetButtonFlags();
		break;
	case ACL_BUTTON_ICMP:
		bFlags = m_AclIcmp.GetButtonFlags();
		break;
	case ACL_BUTTON_NET:
		bFlags = m_AclNet.GetButtonFlags();
		break;
	case ACL_BUTTON_TIME:
		bFlags = m_AclTime.GetButtonFlags();
		break;
	case ACL_BUTTON_TORJAN:
		bFlags = m_AclTorjan.GetButtonFlags();
		break;
	default:
		break;
	}
	EnableButton(bFlags);
}
Example #19
0
void CAclWeb::OnClickAclList(NMHDR* pNMHDR, LRESULT* pResult) 
{
	NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;

	if((m_iListIndex = pNMListView->iItem) == -1) 
		EnableButton(FALSE);
	
	*pResult = 0;
}
Example #20
0
void CAclWeb::OnItemchangedAclList(NMHDR* pNMHDR, LRESULT* pResult) 
{
	NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
	*pResult = 0;

	if((m_iListIndex = pNMListView->iItem) == -1) 
		return;

	EnableButton(TRUE);
}
void EnableDisableBottomButtonsAndRegions( void )
{
	INT8 iExitButtonIndex;

	// this enables and disables the buttons MAP_EXIT_TO_LAPTOP, MAP_EXIT_TO_TACTICAL, and MAP_EXIT_TO_OPTIONS
	for ( iExitButtonIndex = 0; iExitButtonIndex < 3; iExitButtonIndex++ )
	{
		if ( AllowedToExitFromMapscreenTo( iExitButtonIndex ) )
		{
			EnableButton( guiMapBottomExitButtons[ iExitButtonIndex ]);
		}
		else				
		{
			DisableButton( guiMapBottomExitButtons[ iExitButtonIndex ]);
		}
	}

	// enable/disable time compress buttons and region masks
	EnableDisableTimeCompressButtons( );
	CreateDestroyMouseRegionMasksForTimeCompressionButtons( );


	// Enable/Disable map inventory panel buttons

	// if in merc inventory panel
	if( fShowInventoryFlag )
	{
		// and an item is in the cursor
		if( ( gMPanelRegion.Cursor == EXTERN_CURSOR ) || ( InKeyRingPopup( ) == TRUE ) || InItemStackPopup() )
		{
			DisableButton( giMapInvDoneButton );
		}
		else				
		{
			EnableButton( giMapInvDoneButton );
		}

		if( fShowDescriptionFlag )
		{
			ForceButtonUnDirty( giMapInvDoneButton );
		}
	}
}
Example #22
0
void CheckStateOfTheConfirmButton( void )
{
	// will check the state of the confirm button, should it be enabled or disabled?
	if( iCurrentAnswer == -1 )
	{
		// was disabled, enable
		EnableButton( giIMPPersonalityQuizButton[0] );
	}

	return;
}
Example #23
0
void CCmdDlg::OnBnClickedButtonOpen()
{
	if (OpenShell(m_clientid,HandleModuleMsg,this))
	{
		EnableButton(TRUE);
	}
	else
	{
		AfxMessageBox(_T("Open Commander Error!"));
	}
}
Example #24
0
void ItemsRightScrollCallback(GUI_BUTTON *btn, INT32 reason)
{
	if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP)
	{
		gfRenderTaskbar = TRUE;
		eInfo.sScrollIndex++;
		EnableButton( iEditorButton[ITEMS_LEFTSCROLL] );
		if( eInfo.sScrollIndex == max( ((eInfo.sNumItems+1)/2)-6, 0) )
			DisableButton( iEditorButton[ITEMS_RIGHTSCROLL] );
	}
}
Example #25
0
void CheckAndUpdateNextPreviousIMPQuestionButtonStates( void )
{
	if( giCurrentPersonalityQuizQuestion >= giMaxPersonalityQuizQuestion )
	{
		DisableButton( giNextQuestionButton );
	}
	else
	{
		EnableButton( giNextQuestionButton );
	}

	if( giCurrentPersonalityQuizQuestion == 0 )
	{
		DisableButton( giPreviousQuestionButton );
	}
	else
	{
		EnableButton( giPreviousQuestionButton );
	}
}
void EnableDisAbleMapScreenOptionsButton( BOOLEAN fEnable )
{
	if( fEnable )
	{
		EnableButton( guiMapBottomExitButtons[ MAP_EXIT_TO_OPTIONS ] );
	}
	else
	{
		DisableButton( guiMapBottomExitButtons[ MAP_EXIT_TO_OPTIONS ] );
	}
}
Example #27
0
void CAclNet::OnItemchangedListNet(NMHDR* pNMHDR, LRESULT* pResult) 
{
	NM_LISTVIEW* pNMListView	= (NM_LISTVIEW*)pNMHDR;
	*pResult					= 0;

	if((m_iListIndex = pNMListView->iItem) == -1)		
		return;

	if(m_iTreeIndex != 0)			
		EnableButton(TRUE);
}
Example #28
0
OP_STATUS OpButtonStrip::SetButtonInfo(int id, OpInputAction* action, const OpStringC& text, BOOL enabled, BOOL visible, const OpStringC8& name)
{
	OP_ASSERT(0 <= id && (unsigned)id < m_buttons.GetCount());

	SetButtonAction(id, action);
	RETURN_IF_ERROR(SetButtonText(id, text));
	EnableButton(id, enabled);
	ShowButton(id, visible);
	SetButtonName(id, name);

	return OpStatus::OK;
}
Example #29
0
void EnableButtons()
{
    int CopyState = (Running ? 0 : RtfWindowCanCutCopy());

    EnableButton(ID_STOP, Running);
    EnableButton(ID_RUN, !Running);

    EnableButton(ID_CUT, CopyState & DROPEFFECT_MOVE);
    EnableButton(ID_DELETE, CopyState & DROPEFFECT_MOVE);
    EnableButton(ID_COPY, CopyState & DROPEFFECT_COPY);
    EnableButton(ID_PASTE, !Running);
    EnableButton(ID_CLEARSCREEN, !Running);
    EnableButton(ID_SELECTALL, !Running);
}
Example #30
0
void UpDateIMPMainPageButtons( void )
{
	// update mainpage button states
  INT32 iCount = 0;

	// disable all
  for( iCount = 2; iCount < 6; iCount++)
	{
		DisableButton( giIMPMainPageButton[ iCount ] );
	}

	for( iCount = 0; iCount < 4; iCount++ )
	{
		MSYS_DisableRegion( &pIMPMainPageMouseRegions[ iCount ]);
	}
	// enable 
  switch(  iCurrentProfileMode )
	{
		case 0:
		 MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 0 ]);
		 MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 1 ]);
		 MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 2 ]);
		 MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 3 ]);
		break;
		case( 1 ):
		 EnableButton( giIMPMainPageButton[2] );
		 MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 1 ]);
		 MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 2 ]);
		 MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 3 ]);
		break;
		case( 2 ):
		  EnableButton( giIMPMainPageButton[3] );
			MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 0 ]);
		  MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 2 ]);
		  MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 3 ]);
		break;
		case( 3 ):
			EnableButton( giIMPMainPageButton[3] );
		  EnableButton( giIMPMainPageButton[4] );
			MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 0 ]);
		  //MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 1 ]);
		  MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 3 ]);

		break;
		case( 4 ):
		 //MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 1 ]);
		 MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 0 ]);
		 EnableButton( giIMPMainPageButton[3] );
		 EnableButton( giIMPMainPageButton[4] );
	   EnableButton( giIMPMainPageButton[5] );
		break;
	}

	return;
}