diff options
author | nyamatongwe <unknown> | 2004-03-06 22:17:28 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2004-03-06 22:17:28 +0000 |
commit | 3a7020458fd18e50cb04bd8dbecb1df9b08d6539 (patch) | |
tree | ee0185856a4ae51ccfcf7d17d91bdbe864173d32 /doc/Steps.html | |
parent | dce322d98d293baa17d155807746fbdd83ae81ee (diff) | |
download | scintilla-mirror-3a7020458fd18e50cb04bd8dbecb1df9b08d6539.tar.gz |
Fixing broken links.
Diffstat (limited to 'doc/Steps.html')
-rw-r--r-- | doc/Steps.html | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/doc/Steps.html b/doc/Steps.html index 3b74bd342..a946f2517 100644 --- a/doc/Steps.html +++ b/doc/Steps.html @@ -1,5 +1,5 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"><title>How to use the Scintilla Edit Control in windows?</title><link href="style.css" rel="stylesheet"></head><body bgcolor="#ffffff"> +<html><head><meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"><title>How to use the Scintilla Edit Control in windows?</title></head><body bgcolor="#ffffff"> <p><h2>How to use the Scintilla Edit Control in windows?</h2> <p> This should be a little step by step explanation how to use Scintilla in the windows environment. @@ -10,43 +10,43 @@ First of all, load the Scintilla DLL with something like: </p> <pre> - + hmod = LoadLibrary("SciLexer.DLL"); if (hmod==NULL) { - MessageBox(hwndParent, - "The Scintilla DLL could not be loaded.", - "Error loading Scintilla", + MessageBox(hwndParent, + "The Scintilla DLL could not be loaded.", + "Error loading Scintilla", MB_OK | MB_ICONERROR); } </pre> <p> - If the DLL was loaded successfully, then the DLL has registered (yes, by itself) a new + If the DLL was loaded successfully, then the DLL has registered (yes, by itself) a new window class. The new class called "Scintilla" is the new scintilla edit control. </p> <p> Now you can use this new control just like any other windows control. </p> <pre> - - hwndScintilla = CreateWindowEx(0, + + hwndScintilla = CreateWindowEx(0, "Scintilla","", WS_CHILD|WS_VISIBLE|WS_TABSTOP, 10,10,500,400,hwndParent,(HMENU)GuiID, hInstance,NULL); </pre> <p> - Note the new window class name: "Scintilla". By reaching this point you actually included + Note the new window class name: "Scintilla". By reaching this point you actually included a Scintilla Edit Control to your windows program. </p> </p> <p><h2>How to control the Scintilla Edit Control?</h2> <p> You can control Scintilla by sending commands to the Edit Control. - There a 2 ways of doing this. A simple and fast way. + There a 2 ways of doing this. A simple and fast way. </p> <p><h3>The simple way to control Scintilla</h3> <p> - The simple way is just like with any other windows control. You can send messages to the - Scintilla Edit Control and receive notifications from the control. (Note that the notifications + The simple way is just like with any other windows control. You can send messages to the + Scintilla Edit Control and receive notifications from the control. (Note that the notifications are sent to the parent window of the Scintilla Edit Control.) </p> <p> @@ -54,14 +54,14 @@ To send commands to the Scintilla Edit Control you can use the SendMessage function. </p> <pre> - + SendMessage(hwndScintilla,sci_command,wparam,lparam); </pre> <p> like: </p> <pre> - + SendMessage(hwndScintilla,SCI_CREATEDOCUMENT, 0, 0); </pre> <p> @@ -71,12 +71,12 @@ <p><h3>The fast way to control Scintilla</h3> <p> The fast way of controlling the Scintilla Edit Control is to call message handling function by yourself. - You can retrieve a pointer to the message handling function of the Scintilla Edit Control and + You can retrieve a pointer to the message handling function of the Scintilla Edit Control and call it directly to execute a command. This way is much more faster than the SendMessage() way. </p> <p> - 1st you have to use the SCI_GETDIRECTFUNCTION and SCI_GETDIRECTPOINTER commands to - retrieve the pointer to the function and a pointer which must be the first parameter when calling the retrieved + 1st you have to use the SCI_GETDIRECTFUNCTION and SCI_GETDIRECTPOINTER commands to + retrieve the pointer to the function and a pointer which must be the first parameter when calling the retrieved function pointer. You have to do this with the SendMessage way :) </p> @@ -84,7 +84,7 @@ The whole thing has to look like this: </p> <pre> - + int (*fn)(void*,int,int,int); void * ptr; int canundo; @@ -92,7 +92,7 @@ fn = (int (__cdecl *)(void *,int,int,int))SendMessage( hwndScintilla,SCI_GETDIRECTFUNCTION,0,0); ptr = (void *)SendMessage(hwndScintilla,SCI_GETDIRECTPOINTER,0,0); - + canundo = fn(ptr,SCI_CANUNDO,0,0); </pre> <p> @@ -104,7 +104,7 @@ </p> <p><h3>How will I receive notifications?</h3> <p> - Whenever an event occurs where Scintilla wants to inform you about something, the Scintilla Edit Control + Whenever an event occurs where Scintilla wants to inform you about something, the Scintilla Edit Control will send notification to the parent window. This is done by a WM_NOTITY message. When receiving that message, you have to look in the xxx struct for the actual message. </p> @@ -117,7 +117,7 @@ [...] case WM_NOTIFY: - lpnmhdr = (LPNMHDR) lParam; + lpnmhdr = (LPNMHDR) lParam; if(lpnmhdr->hwndFrom==hwndScintilla) { @@ -134,7 +134,7 @@ </pre> </p> </p> - + <p> <i>Page contributed by Holger Schmidt.</i> </p> |