Click here to Skip to main content
14,775,594 members
Home » Discussions » Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: Run exe resource from memory. Pin
Richard Andrew x6426-Mar-14 6:41
professionalRichard Andrew x6426-Mar-14 6:41 
Newscursor problem Pin
neterfari26-Mar-14 2:10
Memberneterfari26-Mar-14 2:10 
GeneralRe: cursor problem Pin
Richard MacCutchan26-Mar-14 2:38
mveRichard MacCutchan26-Mar-14 2:38 
GeneralRe: cursor problem Pin
neterfari26-Mar-14 4:17
Memberneterfari26-Mar-14 4:17 
GeneralRe: cursor problem Pin
neterfari26-Mar-14 4:19
Memberneterfari26-Mar-14 4:19 
GeneralRe: cursor problem Pin
John Schroedl26-Mar-14 6:06
professionalJohn Schroedl26-Mar-14 6:06 
GeneralRe: cursor problem Pin
Richard MacCutchan26-Mar-14 6:35
mveRichard MacCutchan26-Mar-14 6:35 
GeneralRe: cursor problem Pin
neterfari26-Mar-14 11:02
Memberneterfari26-Mar-14 11:02 
Hello thank you for your help.I have 4 function.

Term.h
bool stateCursor; // Clignote du curseur
void CreateCursor(PaintEA e);

Term.cpp
void Term::CreateCursor(PaintEA e){

SolidBrush^ blackBrush = gcnew SolidBrush( Color::Black );
SolidBrush^ redBrush = gcnew SolidBrush( Color::Red );

if(CurPointCurrent!=CurPointPrevious) {

		int deltaX=CurPointCurrent.X-CurPointPrevious.X;
		int deltaY=CurPointCurrent.Y-CurPointPrevious.Y;
		float distance= sqrt(pow((float)deltaX,2)+pow((float)deltaY,2));
		float vectorX=deltaX/distance*polygoneLength;
		float vectorY=deltaY/distance*polygoneLength;
		// Creation des points de polygone 
		Point point1 = Point(CurPointCurrent.X+vectorX,CurPointCurrent.Y+vectorY);
		Point point2 = Point(CurPointCurrent.X+vectorX*-0.866-vectorY*0.5,CurPointCurrent.Y+vectorX*0.5+vectorY*-0.866);
		Point point3 = CurPointCurrent;
		Point point4 = Point(CurPointCurrent.X+vectorX*-0.866-vectorY*-0.5,CurPointCurrent.Y+vectorX*-0.5+vectorY*-0.866);

		// Dessine (clignoter noir <-> rouge)
		array<Point>^ curvePoints = {point1,point2,point3,point4};
		if(stateCursor==false) {
				e->Graphics->FillPolygon( blackBrush , curvePoints );
				stateCursor=true;
		}
		else {
				e->Graphics->FillPolygon( redBrush, curvePoints );
				stateCursor=false;
			}
}
else{
		if(stateCursor==false) {
			e->Graphics->FillEllipse( blackBrush , CurPointCurrent.X-circleRadius,CurPointCurrent.Y-circleRadius,circleRadius*2,circleRadius*2);
			stateCursor=true;
		}
		else {
			e->Graphics->FillEllipse( redBrush , CurPointCurrent.X-circleRadius,CurPointCurrent.Y-circleRadius,circleRadius*2,circleRadius*2 );
			stateCursor=false;
		}
}
}

FormD.h

private: System::Void picB_MainMap_Paint(System::Object^  sender, System::Windows::Forms::PaintEventArgs^  e) {

	if(!first_time) {
		ptr_Term->CreateCursor(e);
	}
}

private: System::Void picB_SubZone_Paint(System::Object^  sender, System::Windows::Forms::PaintEventArgs^  e) {

if(!first_time) {

	ptr_Term->CreateCursor(e);

}
}


Thanks
GeneralRe: cursor problem Pin
Richard MacCutchan26-Mar-14 23:48
mveRichard MacCutchan26-Mar-14 23:48 
GeneralRe: cursor problem Pin
neterfari27-Mar-14 0:08
Memberneterfari27-Mar-14 0:08 
GeneralRe: cursor problem Pin
Richard MacCutchan27-Mar-14 0:18
mveRichard MacCutchan27-Mar-14 0:18 
GeneralRe: cursor problem Pin
neterfari27-Mar-14 1:38
Memberneterfari27-Mar-14 1:38 
QuestionConvert a C# WinSCP program to C++/CLI Pin
biop.codeproject20-Mar-14 0:06
Memberbiop.codeproject20-Mar-14 0:06 
AnswerRe: Convert a C# WinSCP program to C++/CLI Pin
Richard MacCutchan20-Mar-14 0:31
mveRichard MacCutchan20-Mar-14 0:31 
GeneralRe: Convert a C# WinSCP program to C++/CLI Pin
biop.codeproject20-Mar-14 18:24
Memberbiop.codeproject20-Mar-14 18:24 
AnswerRe: Convert a C# WinSCP program to C++/CLI Pin
sunshine@work.20-Mar-14 1:03
professionalsunshine@work.20-Mar-14 1:03 
GeneralRe: Convert a C# WinSCP program to C++/CLI Pin
biop.codeproject20-Mar-14 16:43
Memberbiop.codeproject20-Mar-14 16:43 
QuestionC++ to Managed CLI Pin
sunshine@work.19-Mar-14 6:01
professionalsunshine@work.19-Mar-14 6:01 
AnswerRe: C++ to Managed CLI Pin
Richard MacCutchan19-Mar-14 8:33
mveRichard MacCutchan19-Mar-14 8:33 
GeneralRe: C++ to Managed CLI Pin
sunshine@work.20-Mar-14 0:30
professionalsunshine@work.20-Mar-14 0:30 
GeneralRe: C++ to Managed CLI Pin
sunshine@work.2-Apr-14 4:38
professionalsunshine@work.2-Apr-14 4:38 
GeneralRe: C++ to Managed CLI Pin
Richard MacCutchan2-Apr-14 6:34
mveRichard MacCutchan2-Apr-14 6:34 
GeneralRe: C++ to Managed CLI Pin
sunshine@work.2-Apr-14 22:41
professionalsunshine@work.2-Apr-14 22:41 
GeneralRe: C++ to Managed CLI Pin
Richard MacCutchan3-Apr-14 0:17
mveRichard MacCutchan3-Apr-14 0:17 
GeneralRe: C++ to Managed CLI Pin
sunshine@work.3-Apr-14 23:44
professionalsunshine@work.3-Apr-14 23:44 

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.