base
This commit is contained in:
+235
@@ -0,0 +1,235 @@
|
||||
// TextProgressCtrl.cpp : implementation file
|
||||
//
|
||||
// Written by Chris Maunder (chrismaunder@codeguru.com)
|
||||
// Copyright 1998.
|
||||
//
|
||||
// Modified : 26/05/98 Jeremy Davis, jmd@jvf.co.uk
|
||||
// Added colour routines
|
||||
//
|
||||
// TextProgressCtrl is a drop-in replacement for the standard
|
||||
// CProgressCtrl that displays text in a progress control.
|
||||
//
|
||||
// This code may be used in compiled form in any way you desire. This
|
||||
// file may be redistributed by any means PROVIDING it is not sold for
|
||||
// profit without the authors written consent, and providing that this
|
||||
// notice and the authors name is included. If the source code in
|
||||
// this file is used in any commercial application then an email to
|
||||
// the me would be nice.
|
||||
//
|
||||
// This file is provided "as is" with no expressed or implied warranty.
|
||||
// The author accepts no liability if it causes any damage to your
|
||||
// computer, causes your pet cat to fall ill, increases baldness or
|
||||
// makes you car start emitting strange noises when you start it up.
|
||||
//
|
||||
// Expect bugs.
|
||||
//
|
||||
// Please use and enjoy. Please let me know of any bugs/mods/improvements
|
||||
// that you have found/implemented and I will fix/incorporate them into this
|
||||
// file.
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "TextProgressCtrl.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CTextProgressCtrl
|
||||
|
||||
CTextProgressCtrl::CTextProgressCtrl()
|
||||
{
|
||||
m_nPos = 0;
|
||||
m_nStepSize = 1;
|
||||
m_nMax = 100;
|
||||
m_nMin = 0;
|
||||
m_colFore = ::GetSysColor(COLOR_HIGHLIGHT);
|
||||
m_colBk = 0xFFFFFF;//::GetSysColor(COLOR_MENU);
|
||||
m_colTextFore = 0x98938A;
|
||||
m_colTextBk = 0x056284;
|
||||
m_bShowText = TRUE;
|
||||
|
||||
m_nBarWidth = -1;
|
||||
}
|
||||
|
||||
CTextProgressCtrl::~CTextProgressCtrl()
|
||||
{
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CTextProgressCtrl, CProgressCtrl)
|
||||
//{{AFX_MSG_MAP(CTextProgressCtrl)
|
||||
//ON_WM_ERASEBKGND()
|
||||
ON_WM_PAINT()
|
||||
ON_WM_SIZE()
|
||||
//}}AFX_MSG_MAP
|
||||
ON_WM_NCPAINT()
|
||||
END_MESSAGE_MAP()
|
||||
#include "winuser.h"
|
||||
#include ".\textprogressctrl.h"
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CTextProgressCtrl message handlers
|
||||
|
||||
BOOL CTextProgressCtrl::OnEraseBkgnd(CDC* /*pDC*/)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CTextProgressCtrl::OnSize(UINT nType, int cx, int cy)
|
||||
{
|
||||
CProgressCtrl::OnSize(nType, cx, cy);
|
||||
|
||||
m_nBarWidth = -1; // Force update if SetPos called
|
||||
}
|
||||
|
||||
void CTextProgressCtrl::OnPaint()
|
||||
{
|
||||
if (m_nMin >= m_nMax)
|
||||
return;
|
||||
|
||||
CRect LeftRect, RightRect, ClientRect;
|
||||
GetClientRect(ClientRect);
|
||||
|
||||
double Fraction = (double)(m_nPos - m_nMin) / ((double)(m_nMax - m_nMin));
|
||||
|
||||
CPaintDC dc(this); // device context for painting (if not double buffering)
|
||||
|
||||
LeftRect = RightRect = ClientRect;
|
||||
|
||||
LeftRect.right = LeftRect.left + (int)((LeftRect.right - LeftRect.left)*Fraction);
|
||||
dc.FillSolidRect(LeftRect, m_colFore);
|
||||
|
||||
RightRect.left = LeftRect.right;
|
||||
dc.FillSolidRect(RightRect, m_colBk);
|
||||
|
||||
if (m_bShowText)
|
||||
{
|
||||
CString str;
|
||||
if (m_strText.GetLength())
|
||||
str = m_strText;
|
||||
else
|
||||
str.Format(_T("%d%%"), (int)(Fraction*100.0));
|
||||
|
||||
dc.SetBkMode(TRANSPARENT);
|
||||
|
||||
CRgn rgn;
|
||||
rgn.CreateRectRgn(LeftRect.left, LeftRect.top, LeftRect.right, LeftRect.bottom);
|
||||
dc.SelectClipRgn(&rgn);
|
||||
dc.SetTextColor(m_colTextBk);
|
||||
|
||||
HFONT hSysFont = ( HFONT )GetStockObject( DEFAULT_GUI_FONT );
|
||||
|
||||
CFont* pFont = CFont::FromHandle( hSysFont );
|
||||
CFont* pOldFont = dc.SelectObject( pFont );
|
||||
|
||||
dc.DrawText(str, ClientRect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
|
||||
|
||||
rgn.DeleteObject();
|
||||
rgn.CreateRectRgn(RightRect.left, RightRect.top, RightRect.right, RightRect.bottom);
|
||||
dc.SelectClipRgn(&rgn);
|
||||
dc.SetTextColor(m_colTextFore);
|
||||
|
||||
dc.DrawText(str, ClientRect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
|
||||
dc.SelectObject( pOldFont );
|
||||
pFont->DeleteObject();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CTextProgressCtrl::SetForeColour(COLORREF col)
|
||||
{
|
||||
m_colFore = col;
|
||||
}
|
||||
|
||||
void CTextProgressCtrl::SetBkColour(COLORREF col)
|
||||
{
|
||||
m_colBk = col;
|
||||
}
|
||||
|
||||
COLORREF CTextProgressCtrl::GetForeColour()
|
||||
{
|
||||
return m_colFore;
|
||||
}
|
||||
|
||||
COLORREF CTextProgressCtrl::GetBkColour()
|
||||
{
|
||||
return m_colBk;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CTextProgressCtrl message handlers
|
||||
|
||||
void CTextProgressCtrl::SetShowText(BOOL bShow)
|
||||
{
|
||||
if (::IsWindow(m_hWnd) && m_bShowText != bShow)
|
||||
Invalidate();
|
||||
|
||||
m_bShowText = bShow;
|
||||
}
|
||||
|
||||
void CTextProgressCtrl::SetText(LPCTSTR lpszText)
|
||||
{
|
||||
m_strText = lpszText;
|
||||
|
||||
if (::IsWindow(m_hWnd) && m_bShowText)
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
void CTextProgressCtrl::SetRange(int nLower, int nUpper)
|
||||
{
|
||||
m_nMax = nUpper;
|
||||
m_nMin = nLower;
|
||||
}
|
||||
|
||||
int CTextProgressCtrl::SetPos(int nPos, LPCTSTR lpszText)
|
||||
{
|
||||
if (!::IsWindow(m_hWnd))
|
||||
return -1;
|
||||
|
||||
if (lpszText)
|
||||
m_strText = lpszText;
|
||||
|
||||
int nOldPos = m_nPos;
|
||||
m_nPos = nPos;
|
||||
|
||||
CRect rect;
|
||||
GetClientRect(rect);
|
||||
|
||||
double Fraction = (double)(m_nPos - m_nMin) / ((double)(m_nMax - m_nMin));
|
||||
int nBarWidth = (int) (Fraction * rect.Width());
|
||||
|
||||
if (nBarWidth != m_nBarWidth) {
|
||||
m_nBarWidth = nBarWidth;
|
||||
// RedrawWindow();
|
||||
}
|
||||
Invalidate(FALSE);
|
||||
|
||||
return nOldPos;
|
||||
}
|
||||
|
||||
int CTextProgressCtrl::StepIt()
|
||||
{
|
||||
return SetPos(m_nPos + m_nStepSize);
|
||||
}
|
||||
|
||||
int CTextProgressCtrl::OffsetPos(int nPos)
|
||||
{
|
||||
return SetPos(m_nPos + nPos);
|
||||
}
|
||||
|
||||
int CTextProgressCtrl::SetStep(int nStep)
|
||||
{
|
||||
int nOldStep = m_nStepSize;
|
||||
m_nStepSize = nStep;
|
||||
return nOldStep;
|
||||
}
|
||||
|
||||
void CTextProgressCtrl::OnNcPaint()
|
||||
{
|
||||
|
||||
// TODO: 여기에 메시지 처리기 코드를 추가합니다.
|
||||
// 그리기 메시지에 대해서는 CProgressCtrl::OnNcPaint()을(를) 호출하지 마십시오.
|
||||
}
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
Stubs for SSL support when no SSL library has been configured
|
||||
Copyright (C) 2002-2005, Joe Orton <joe@manyfish.co.uk>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA
|
||||
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h> /* for NULL */
|
||||
|
||||
#include "ne_ssl.h"
|
||||
#include "ne_session.h"
|
||||
|
||||
char *ne_ssl_readable_dname(const ne_ssl_dname *dn)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ne_ssl_certificate *ne_ssl_cert_read(const char *filename)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int ne_ssl_cert_cmp(const ne_ssl_certificate *c1, const ne_ssl_certificate *c2)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
const ne_ssl_certificate *ne_ssl_cert_signedby(const ne_ssl_certificate *cert)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const ne_ssl_dname *ne_ssl_cert_issuer(const ne_ssl_certificate *cert)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const ne_ssl_dname *ne_ssl_cert_subject(const ne_ssl_certificate *cert)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ne_ssl_cert_free(ne_ssl_certificate *cert) {}
|
||||
|
||||
ne_ssl_client_cert *ne_ssl_clicert_read(const char *filename)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const ne_ssl_certificate *ne_ssl_clicert_owner(const ne_ssl_client_cert *ccert)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int ne_ssl_clicert_encrypted(const ne_ssl_client_cert *ccert)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int ne_ssl_clicert_decrypt(ne_ssl_client_cert *ccert, const char *password)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
void ne_ssl_clicert_free(ne_ssl_client_cert *ccert) {}
|
||||
|
||||
void ne_ssl_trust_default_ca(ne_session *sess) {}
|
||||
|
||||
ne_ssl_context *ne_ssl_context_create(int mode)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ne_ssl_context_trustcert(ne_ssl_context *ctx, const ne_ssl_certificate *cert)
|
||||
{}
|
||||
|
||||
int ne_ssl_context_set_verify(ne_ssl_context *ctx,
|
||||
int required,
|
||||
const char *ca_names,
|
||||
const char *verify_cas)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
void ne_ssl_context_destroy(ne_ssl_context *ctx) {}
|
||||
|
||||
int ne_ssl_cert_digest(const ne_ssl_certificate *cert, char digest[60])
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
void ne_ssl_cert_validity(const ne_ssl_certificate *cert, char *from, char *until)
|
||||
{}
|
||||
|
||||
const char *ne_ssl_cert_identity(const ne_ssl_certificate *cert)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
const char *ne_ssl_clicert_name(const ne_ssl_client_cert *ccert)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int ne_ssl_dname_cmp(const ne_ssl_dname *dn1, const ne_ssl_dname *dn2)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int ne_ssl_cert_write(const ne_ssl_certificate *cert, const char *filename)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
char *ne_ssl_cert_export(const ne_ssl_certificate *cert)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ne_ssl_certificate *ne_ssl_cert_import(const char *data)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ne_ssl_set_clicert(ne_session *sess, const ne_ssl_client_cert *cc)
|
||||
{}
|
||||
Reference in New Issue
Block a user