• Welcome to Jose's Read Only Forum 2023.
 

Tipps for SED-Editor Users

Started by Theo Gottwald, September 24, 2010, 09:31:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Theo Gottwald

What are your best tipps for the SED-Editor?

I can start with one.

Assume you make a DLL. Sometimes you compile the DLL as EXE for testing.
You could use something like this:


%DLL=0
%DEB=1

#OPTIMIZE SIZE

#IF %DLL=1
 #COMPILE DLL
#ELSE
#COMPILE EXE
#ENDIF

#IF %DLL = 0
FUNCTION WINMAIN (BYVAL hInstance AS DWORD, BYVAL hPrevInstance AS DWORD, BYVAL lpszCmdLine AS ASCIIZ PTR, BYVAL nCmdShow AS LONG) AS LONG      
...
END FUNCTION
#ELSE
FUNCTION LIBMAIN(BYVAL hInstance AS DWORD, _
                BYVAL lReason   AS LONG, _
                BYVAL lReserved AS LONG) AS LONG

 SELECT CASE AS LONG lReason
    CASE %DLL_PROCESS_ATTACH
     LIBMAIN = 1
     EXIT FUNCTION

   ' This DLL is about to be unloaded
   CASE %DLL_PROCESS_DETACH

  ' A [New] thread is starting (see THREADID)
   CASE %DLL_THREAD_ATTACH
     EXIT FUNCTION

   ' This thread is closing (see THREADID)
   CASE %DLL_THREAD_DETACH
     EXIT FUNCTION

 END SELECT

 LIBMAIN = 0   ' Indicate failure to initialize the DLL!
END FUNCTION
#ENDIF


If you do this, SED will refuse to start a compiled EXE (in case %DLL=0)!
It will say "You can't start a DLL" like that.

What you need to do is, a small change:

#IF %DLL=1
 #COMPILE DLL
#ELSE
#COMPILE EXE
#ENDIF


change this to:


' Sesam open
#IF %DLL=1
 #COMPILE EXE
#ELSE
#COMPILE DLL
#ENDIF


Now SED will let you run the compiled EXE!

William Burns

There are tons of features in SED that I love.   However I wonder if some of the more subtle features have been overlooked by people.  For example:

Did you know that you can highlight something in SED and just press F3 to search for the next occurrence of that text? (no need for copy in to the Ctrl-F window first.)  To search for something else, just highlight the other text/variable you want to find and press F3 again.  I use this quick search method all day long and it saves me time and keystrokes.  It is a very fast way to find where each variable is used.

Also, did you know that if you need to find the length of some characters or a phrase you can just highlight it and at the bottom it will tell you how many characters are selected.   This may not sound that helpful, but before this I found my self counting characters when I needed to do something like this: If Left$(sModel, 15) = "Dell Optiplex GX" ThenWith this feature I can just highlight the "Dell Optiplex GX" and see that the Left$() needs to be changed to 16. (the 15 which would never find anything)

I also use the bookmarks functions to jump between related functions.  (Ctrl-F2 to set a bookmark and F2 to jump between them)

Another feature that is easy to overlook is the ability to split the viewing window to show 2 different places in the same source code at the same time.   Very handy if you need to reference one section while working on a related function.   (just drag the top line down)

That is just to name a few.

José Roca

#2
 
Two new little features I plan to add is to allow multiple selection and automatically convert end of lines when pasting code, i.e. if you paste code that ends with a single $LF or a single $CR, it will be converted to $CRLF.

I have started a reworked version of the editor, using a class with properties, to avoid the too many globals currently used, result of integrating disparate code. By using properties, we just ned a global variable, pSed, to have access to all the values. I also have written a new include file with wrappers for each and every one Scintilla messages, to ease its use.

It has an additional toolbar at the bottom for easier access to several edit features and tools, for example PBForms, the COM browsers and two excelent free tools: Toobar Paint, to make bitmap strips for image lists, and ResEd, a visual designer that uses resource files.

The keywords will be in a text file to allow to add new ones without having to modify and recompile the code.

I want to add syntax coloring for .rc and .xml files, to allow easy editing of resource files and manifests in the editor. With Windows 7, manifests are needed for almost all GUI applications, e.g. to load the version common controls library and to give access privileges.

I will also provide many template code and skeletons for a variety of applications.

What will take more time is to rework code not implemented by me, so I first will implement the core features and later I will try to incorporate other parts.

I'm also working in version 2.0 of the Windows API headers and reworking my custom controls and examples, so all this will take months. Be patient, please. I think that the result will be worth the waiting.

Nick Melnick

Actually William, you can split the windows 4 ways.
Drag the left bar(s) to the right.
Any of these except the lower right quadrant can be 'initialized as new'.
This creates a new blank document that can be used for any sort of
general purpose text editing and saved separately.

Print preview windows will always try to scale themselves to SED's client area.
It is possible to have 2 or more preview's open.
You could for example, launch a preview in portrait mode, switch to landscape
mode and launch another preview. You could then compare the two.

Sed will remember the last orientation you used at startup.
If you prefer landscape for example, it will print in that mode until you change it.

Printer margins can be retained when switching from portrait to landscape and
back again. In other words, if you prefer a one inch bottom margin in portrait
mode, that's the margin you'll have in landscape.

If you have a range of text selected, and hit the print toolbar button, only the
selection will be printed. This can be overridden by deselecting the text or using
the print dialog.

If your mouse has a scrollwheel, holding the <ctrl> key and turning the wheel will
dynamically change the displayed font size.
This only affects the window with keyboard focus.

José Roca

#4
 
How about using the WebBrowser control print preview dialog for the task?

I have improved the routine to convert the text to HTML, using XHTML 1.1 and embedded css styles. After converting the text, I embed an instance of the web browser control, navigate to about:blank, write the text to it using MSHTML and call the Print Preview dialog. See attached picture.

Isn't nice the power that provides my Windows API Headers?

William Burns

Good point Nick.   However most of the time I only need to reference a different place in the same file which is why I use it.  (I just use the tabs at the top to switch between different docs.)   But that is a good trick to know, unfortunately I sometimes forget it also when I need it and find myself switching back and forth between screens.  ::)

José, that print preview windows looks very nice.   And yes I love using your API header files.  They follow the C++ headers so that it is much closer aligned to the MSDN documents.

Patrice Terrier

I can't remember how to setup the column mode for copy/paste a code selection?

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Theo Gottwald

QuoteI'm also working in version 2.0 of the Windows API headers and reworking my custom controls and examples, so all this will take months. Be patient, please. I think that the result will be worth the waiting.

Sure we will be patient!
As we are with PB <next version>.

José Roca

Quote from: Patrice Terrier on September 28, 2010, 08:13:24 AM
I can't remember how to setup the column mode for copy/paste a code selection?

...

Ctrl + Alt + Left Mouse Button

Patrice Terrier

Thank you José!

I have another one:
How to remove extra space(s) at the end of line(s)?

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

José Roca

Quote
How to remove extra space(s) at the end of line(s)?

Menu --> Options --> Editor --> Trim trailing blanks (12th check box on the left side). If checked, it will remove trailing blanks automatically when saving or loading a file.

Patrice Terrier

That's perfect.

Now i don't have any more reasons of using UltraEdit :D

Thanks!

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com