Ejemplo n.º 1
0
BOOL CGroupInfoDlg::OnInitDialog(CWindow wndFocus, LPARAM lInitParam)
{
	SetWindowPos(NULL, 0, 0, 400, 470, SWP_NOMOVE);

	CenterWindow();

	// set icons
	m_hDlgIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
	SetIcon(m_hDlgIcon, TRUE);
	m_hDlgSmallIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
	SetIcon(m_hDlgSmallIcon, FALSE);

	Init();		// 初始化

	CGroupInfo * lpGroupInfo = GetGroupInfoPtr();
	if (lpGroupInfo != NULL)
	{
		if (!lpGroupInfo->IsHasGroupInfo())
			m_lpQQClient->UpdateGroupInfo(m_nGroupCode);
		if (!lpGroupInfo->IsHasGroupNumber())
			m_lpQQClient->UpdateGroupNum(m_nGroupCode);

		CString strTitle;
		strTitle.Format(_T("群设置 - %s"), lpGroupInfo->m_strName.c_str());
		m_SkinDlg.SetTitleText(strTitle);
	}

	UpdateCtrls();

	return TRUE;
}
Ejemplo n.º 2
0
BOOL CBuddyInfoDlg::OnInitDialog(CWindow wndFocus, LPARAM lInitParam)
{
	SetWindowPos(NULL, 0, 0, 580, 480, SWP_NOMOVE);

	CenterWindow();

	// set icons
	m_hDlgIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
	SetIcon(m_hDlgIcon, TRUE);
	m_hDlgSmallIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
	SetIcon(m_hDlgSmallIcon, FALSE);

	Init();		// 初始化

	CBuddyInfo * lpBuddyInfo = GetBuddyInfoPtr();
	if (NULL == lpBuddyInfo)
		return TRUE;

	CString strTitle;
	if (m_bIsGMember || lpBuddyInfo->m_strMarkName.empty())
		strTitle.Format(_T("%s的资料"), lpBuddyInfo->m_strNickName.c_str());
	else
		strTitle.Format(_T("%s的资料"), lpBuddyInfo->m_strMarkName.c_str());
	m_SkinDlg.SetTitleText(strTitle);

	if (m_lpQQClient != NULL)
	{
		if (!lpBuddyInfo->IsHasBuddyInfo())
		{
			if (!m_bIsGMember)
				m_lpQQClient->UpdateBuddyInfo(m_nQQUin);
			else
				m_lpQQClient->UpdateGroupMemberInfo(m_nGroupCode, m_nQQUin);
		}
		if (!lpBuddyInfo->IsHasQQNum())
		{
			if (!m_bIsGMember)
				m_lpQQClient->UpdateBuddyNum(m_nQQUin);
			else
				m_lpQQClient->UpdateGroupMemberNum(m_nGroupCode, m_nQQUin);
		}
		if (!lpBuddyInfo->IsHasQQSign())
		{
			if (!m_bIsGMember)
				m_lpQQClient->UpdateBuddySign(m_nQQUin);
			else
				m_lpQQClient->UpdateGroupMemberSign(m_nGroupCode, m_nQQUin);
		}
	}

	UpdateCtrls();

	return TRUE;
}
Ejemplo n.º 3
0
void ColorChoice::InitColors(ConfigManager * cfg)
{
    s_colors.clear();
    // Add the "Other..." item
    s_colors.push_back(wxNullColour, other_color);
    // Add colors from config
    if (cfg)
    {
        std::set<wxString> colors;
        AddColors(colors, &cfg->GetGroup());
        std::set<wxString>::iterator it;
        for (it = colors.begin(); it != colors.end(); ++it)
            s_colors.push_back(wxColour(*it));
    }
    UpdateCtrls();
}
Ejemplo n.º 4
0
void ColorChoice::SetValue(const wxString & value)
{
    if (value.empty())
        return;
    wxColour color(value);
    if (! color.IsOk())
        return;
    m_lastColor = color;
    // Set the selection
    if (! SetStringSelection(color.GetAsString()))
    {
        // If this color doesn't already exist in the ctrl, add it.
        s_colors.push_back(color);
        UpdateCtrls();
        SetStringSelection(color.GetAsString());
    }
}
Ejemplo n.º 5
0
    : wxOwnerDrawnComboBox(parent, id, wxEmptyString, wxDefaultPosition,
                           wxDefaultSize, wxArrayString(), wxCB_READONLY)
#endif
{
    // If the ctrl is too small the color box gets messed up in wxOSX
    SetMinSize(wxSize(GetCharWidth() * 22, -1));
    s_ctrls.push_back(this);
    // Make sure we have a list of colors
    if (s_colors.empty())
        InitColors();
    else
        UpdateCtrls();
    // Set the initial value
    SetColor(color.IsOk() ? color : *wxWHITE);
    // Connect the event handler
#ifndef __WXOSX__
    Connect(wxEVT_COMMAND_COMBOBOX_SELECTED,
#else
    Connect(wxEVT_COMMAND_CHOICE_SELECTED,
#endif
            wxCommandEventHandler(ColorChoice::OnSelection));
}
Ejemplo n.º 6
0
void CBuddyInfoDlg::OnUpdateBuddySign()
{
	UpdateCtrls();
}
Ejemplo n.º 7
0
void CBuddyInfoDlg::OnUpdateBuddyNumber()
{
	UpdateCtrls();
}
Ejemplo n.º 8
0
void CEncoderPropPage::OnEnctype() 
{
	SetModified(TRUE);
	UpdateCtrls();
}
Ejemplo n.º 9
0
BOOL CEncoderPropPage::OnInitDialog() 
{
	m_nEncoders = 0;

	CPropertyPage::OnInitDialog();

	// translate dialog resources
	g_language.InitDialogStrings( this, IDD );

	// Get active encoder type
	m_nEncoderType = g_config.GetEncoderType();

	// Clear number of encoders
	m_nEncoders = 0;

	// add all encoder
	for ( int i = 0; i< NUMENCODERS; i++ )
	{
		m_pEncoder[ m_nEncoders ] = EncoderObjectFactory( ENCODER_TYPES( i ) );

		if ( m_pEncoder[ m_nEncoders ] && m_pEncoder[ m_nEncoders ]->GetAvailable() )
		{
            CUStringConvert strCnv;

			// Get the encoder string ID from the encoder
			m_EncoderSel.AddString( strCnv.ToT( m_pEncoder[ m_nEncoders ]->GetEncoderID() ) );

			// Is this the selected encoder ?
			if ( g_config.GetEncoderType() == m_pEncoder[ m_nEncoders ]->GetID() )
			{
				m_EncoderSel.SetCurSel( m_nEncoders  );
			}

			m_nEncoders++;
		}
		else
		{
			// we don't use the created object, so delete it to avoid memory leaks
			delete m_pEncoder[ m_nEncoders ];
			m_pEncoder[ m_nEncoders ] = NULL;
		}
	}
	
	// Get the location of the dialog place holder
	CRect rcSheet;
	GetDlgItem( IDC_ENCOPTS )->GetWindowRect( &rcSheet );
	ScreenToClient( &rcSheet );
	rcSheet.left-=7;
	rcSheet.top-=7;

	// Create all the encoder dialog boxes
	for (int i = 0; i < m_nEncoders; i++ )
	{
		// Make sure that the encoder does exist
		ASSERT( m_pEncoder[ i ] );

		if ( m_pEncoder[ i ]  )
		{
			// Get a pointer to the dialog option string
			CEncoderDlg* pOptsDlg = m_pEncoder[ i ]->GetSettingsDlg();

			// Make sure it is valid
			ASSERT( pOptsDlg );

			if ( pOptsDlg )
			{
				// Create the dialog box
				pOptsDlg->Create( pOptsDlg->GetIDD(), this );
				// Set it to the proper location

				// get the previous tab order control
				UINT nFlags = SWP_NOSIZE|SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER ;

				pOptsDlg->SetWindowPos( NULL, rcSheet.left, rcSheet.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE );

				// Update controls
				pOptsDlg->SetControls( m_pEncoder[ i ] );
			}
		}
	}

	// Enable the right dialog box
	SelectEncOptionDlg();

	m_ThreadPriority.SetCurSel( g_config.GetThreadPriority() - THREAD_PRIORITY_LOWEST );

	// Update Controls
	UpdateData( FALSE );

	UpdateCtrls();

	return TRUE;
}
Ejemplo n.º 10
0
// 更新群号码
void CGroupInfoDlg::OnUpdateGroupNumber()
{
	UpdateCtrls();
}
Ejemplo n.º 11
0
// 更新群信息
void CGroupInfoDlg::OnUpdateGroupInfo()
{
	UpdateCtrls();
}