Click here to Skip to main content
15,902,276 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Commit to Disk Pin
Neville Franks25-Aug-03 10:43
Neville Franks25-Aug-03 10:43 
GeneralRe: Commit to Disk Pin
jmf31415925-Aug-03 11:43
jmf31415925-Aug-03 11:43 
GeneralRe: Commit to Disk Pin
Neville Franks25-Aug-03 12:03
Neville Franks25-Aug-03 12:03 
GeneralRe: Commit to Disk Pin
parths25-Aug-03 15:25
parths25-Aug-03 15:25 
GeneralGibberish code Pin
dog_spawn25-Aug-03 15:06
dog_spawn25-Aug-03 15:06 
QuestionApplication-Close/Minimize effect, where? Pin
Exim25-Aug-03 6:39
Exim25-Aug-03 6:39 
AnswerRe: Application-Close/Minimize effect, where? Pin
Mikey_E25-Aug-03 10:16
professionalMikey_E25-Aug-03 10:16 
GeneralAutosrolling in an CEdit Pin
Bateman25-Aug-03 6:07
Bateman25-Aug-03 6:07 
Hi!
I have a problem with Autoscrolling in an CEdit. The Code i written works fine for scrolling but has an ugly graphic-error.
It scrolls the text in the direction where i have the mousecursor. If i scroll up the first visible line is shown 2 times.
When I scroll down it is the last visible line.
Here is the code:
// MyEdit.cpp: Implementierungsdatei
//

#include "stdafx.h"
#include "MyEdit.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// MyEdit

MyEdit::MyEdit()
{
iScrollCount = 0;
iScrollSpeed = 5;
}

MyEdit::~MyEdit()
{
}


BEGIN_MESSAGE_MAP(MyEdit, CEdit)
//{{AFX_MSG_MAP(MyEdit)
ON_WM_SETCURSOR()
ON_WM_NCHITTEST()
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// Behandlungsroutinen für Nachrichten MyEdit

BOOL MyEdit::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// TODO: Code für die Behandlungsroutine für Nachrichten hier einfügen und/oder Standard aufrufen
HCURSOR g_CursorIcon;
g_CursorIcon=LoadCursor (NULL,IDC_SIZENS);
SetCursor(g_CursorIcon);
//return CEdit::OnSetCursor(pWnd, nHitTest, message);
return 1;
}


UINT MyEdit::OnNcHitTest(CPoint point)
{
// TODO: Code für die Behandlungsroutine für Nachrichten hier einfügen und/oder Standard aufrufen
CRect rect;
GetClientRect( &rect );
ScreenToClient(&point);

if(point.y > (rect.bottom - 60))
{
KillTimer(0);
SetTimer(1,25,0);
}
else if(point.y < 60)
{
KillTimer(1);
SetTimer(0,25,0);
}
else
{
KillTimer(0);
KillTimer(1);
}


return CEdit::OnNcHitTest(point);
}

void MyEdit::SetScrollSpeed(int Speed)
{
iScrollSpeed = Speed;
}

void MyEdit::OnTimer(UINT nIDEvent)
{
// TODO: Code für die Behandlungsroutine für Nachrichten hier einfügen und/oder Standard aufrufen
CPoint point;
GetCursorPos(&point);
ScreenToClient(&point);
CRect rect;
GetClientRect( &rect );
if(point.y > rect.bottom || point.y < 0 || point.y < rect.bottom && point.x < rect.left ||point.y < rect.bottom && point.x > rect.right )
{

}
else
{
if(nIDEvent == 1)
{
if(iScrollCount == iScrollSpeed)
{
LineScroll(1,0);
iScrollCount = 0;
}
else
iScrollCount++;
}
else
{
if(iScrollCount == iScrollSpeed)
{
LineScroll(-1,0);
iScrollCount = 0;
}
else
iScrollCount++;
}
}
CEdit::OnTimer(nIDEvent);
}

#############################################################
Does anyone know what to do for showing the scrolled text correctly?
Patrick
Generalrefference a pointer to another process !!! Pin
mr200325-Aug-03 5:46
mr200325-Aug-03 5:46 
GeneralRe: refference a pointer to another process !!! Pin
valikac25-Aug-03 5:54
valikac25-Aug-03 5:54 
GeneralRe: refference a pointer to another process !!! Pin
Babayan Hovhannes26-Aug-03 0:04
Babayan Hovhannes26-Aug-03 0:04 
GeneralRe: refference a pointer to another process !!! Pin
mr200326-Aug-03 6:41
mr200326-Aug-03 6:41 
GeneralDev studio question for experts Pin
YaronNir25-Aug-03 4:12
YaronNir25-Aug-03 4:12 
GeneralRe: Dev studio question for experts Pin
valikac25-Aug-03 5:56
valikac25-Aug-03 5:56 
GeneralRe: Dev studio question for experts Pin
YaronNir25-Aug-03 20:40
YaronNir25-Aug-03 20:40 
QuestionMove text in edit box down and to the right 1-pixel? Pin
DanYELL25-Aug-03 3:55
DanYELL25-Aug-03 3:55 
GeneralOnPaint message Pin
El'Cachubrey25-Aug-03 3:55
El'Cachubrey25-Aug-03 3:55 
GeneralCannot load DLL, please Help ! Pin
Babayan Hovhannes25-Aug-03 3:51
Babayan Hovhannes25-Aug-03 3:51 
GeneralRe: Cannot load DLL, please Help ! Pin
Joel Lucsy25-Aug-03 4:37
Joel Lucsy25-Aug-03 4:37 
GeneralRe: Cannot load DLL, please Help ! Pin
Babayan Hovhannes25-Aug-03 4:41
Babayan Hovhannes25-Aug-03 4:41 
GeneralRe: Cannot load DLL, please Help ! Pin
Babayan Hovhannes25-Aug-03 4:45
Babayan Hovhannes25-Aug-03 4:45 
GeneralRe: Cannot load DLL, please Help ! Pin
Joel Lucsy25-Aug-03 4:55
Joel Lucsy25-Aug-03 4:55 
GeneralRe: Cannot load DLL, please Help ! Pin
Babayan Hovhannes25-Aug-03 5:00
Babayan Hovhannes25-Aug-03 5:00 
GeneralAfxMessageBox() Pin
MemLeak25-Aug-03 3:26
MemLeak25-Aug-03 3:26 
GeneralRe: AfxMessageBox() Pin
Arjan Schouten25-Aug-03 3:31
Arjan Schouten25-Aug-03 3:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.