|
Do you plan to release a C# version of your control? I mean a Wrapper class which can be used in .NET applications. It looks like a real cool control.
the approach rather than the solution
|
|
|
|
|
Pavan Podila wrote: Do you plan to release a C# version of your control? I mean a Wrapper class which can be used in .NET applications. It looks like a real cool control.
The ActiveX (OCX) version can be used in .NET applications. It is a simple wrapper around the control which makes it possible to use brainchild in VB, .NET etc.
Bye,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
Anyway to set the length of the line numbers? After 99,999 lines, the line number gutter only displays dashes.
Granted, that's a lot of lines, but it'd be nice to have the option to specify how many line number characters there are.
BTW, I am using the OCX version in a VB6 app.
|
|
|
|
|
FCBLogin wrote: Anyway to set the length of the line numbers? After 99,999 lines, the line number gutter only displays dashes.
Granted, that's a lot of lines, but it'd be nice to have the option to specify how many line number characters there are.
BTW, I am using the OCX version in a VB6 app.
Currently it is not possible to specify this behaviour. The control simply decides that the line number margin has a maximum of 5 characters. Never thought anybody would run against this limit I will put option this on my TODO list.
Enjoy,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
I just spent the day troubleshooting this problem:
BCDLL.CPL silently fails to load.
The application I am writing suddenly began to crash when it begins to run.
I finally narrowed it down to fact that I set the registry information as described in step 10. The CPL files were put into the directory described in the Settings string item.
The first problem is that during SetupProcess() you are concatenating the logged in user name to the path described in the Setting registry item. I don't see this documented anywhere. Okay, so you are creating the user directory if it doesn't exist; that leads us to the second problem which is there aren't any CPL files put into that directory after it is created. What happens is that LoadParserFiles() fails which leads to SetupProcess() failing. If you look at line 404 of thread.c, it looks like you are adding the default node back but at line 416 you are freeing and then you are freeing the memory pool at line 421 and then returning false. I think, somewhere else, you are writing to this memory pool or accessing the default node.
I suspect that you really want the line "return TRUE ;" right after line 404 if the files are not present... and I did that and it is much better behaved. This problem doesn't exist if the Settings registry entry does not exist.
BCDLL.cpl now lets me know there are no files in the directory before it goes away which is only slightly better than before when it would just crash.
|
|
|
|
|
Michael Bergman wrote: I suspect that you really want the line "return TRUE ;" right after line 404 if the files are not present... and I did that and it is much better behaved. This problem doesn't exist if the Settings registry entry does not exist.
I have put this one on my TODO list. Sorry for the inconvenience.
Michael Bergman wrote: BCDLL.cpl now lets me know there are no files in the directory before it goes away which is only slightly better than before when it would just crash.
There are plans to change this behaviour and let the configuration tool respond as follows:
1) No registry settings?
Popup a directory selector and let the user select a directory to store settings files.
2) No files?
Save at least the default configuration in the selected directory.
Enjoy,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
Jan,
It seems that when you open the search dialog, and type in the search word, two instances of the dialog box are opened. I am using the OCX control.
If you do not type in the search word and select the search word from the drop down box then there is only one instance of the Find dialog box.
Would you know why that is? I would not expect a new instance to open when the search word is typed as opposed to it being selected from the drop down list.
Thanks
Shakti
|
|
|
|
|
Shakti Goel wrote:
It seems that when you open the search dialog, and type in the search word, two instances of the dialog box are opened. I am using the OCX control.
If you do not type in the search word and select the search word from the drop down box then there is only one instance of the Find dialog box.
Would you know why that is? I would not expect a new instance to open when the search word is typed as opposed to it being selected from the drop down list.
I can't reproduce this behaviour. It seems strange though because each instance of the control only has one instance of the search and one instance of the replace dialog. If two dialogs show then it seems more likely that both the search and replace dialogs are open at the same time rather than two search dialogs, not that this would be correct behaviour though...
Does this happen on specific search strings or all search strings?
Bye,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
Hello,
Thanks for the nice control. However, it does not work correctly with French keyboard layout - it is impossible to type {, }, [ and ] characters. On that layout these characters are produced when holding left alt key with the special key combinations; but the control does not accept this.
Any resolution of this problem?
|
|
|
|
|
I have just tried out the control and encountered the same problem. On the german keyboard layout the characters '{', '[', ']' and '}' are located on the keys 7-0 used in comination with the special key Ctrl+Alt.
So what you have to do is to enter those combinations into your language definition files like this:
;
; Keyboard settings
;
Key=Ctrl Alt 7
InsertText={
EndKey
I think the way character messages are handled is very unfortunate in this matter (especially since these seem not to be inherited from the default set), but it still is a very good control though.
-- * Computers make very fast, very accurate mistakes.
|
|
|
|
|
Hi
Sometimes there are strings which have embedded single quotes. For example
v_str = 'select * from emp where ename
= ''SCOTT'' and deptno = 10';
The string is on two lines.
The two single quotes around SCOTT are supposed to embedded inside the single quote before SELECT and after 10.
The entire string from select ... deptno=10
should be highlighted in red (chosen color for strings).
However, the string is highlighted in red only in the first line but in the second line it is no longer in red.
How can I modify the T-SQL parser to show the entire string in red with embedded single quotes?
It seems that it something that needs to be fixed in the dll.
Thanks
|
|
|
|
|
Jan,
Any word on this? When there are two strings next to each other, syntax highlighting does not work.
E.g.,
'grgaer''gergare
htyhrty'
Thanks
Shakti
|
|
|
|
|
Shakti Goel wrote:
Any word on this? When there are two strings next to each other, syntax highlighting does not work.
Nothing other than it is on my TODO list. It appears to be a parser bug...
Bye,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
I alway get access violations in the function UpdateSettings.
This comes from the fact, that the very first parser in plParsers is freed with FreeParserNode, but afterwards the same parser is also member of the list pll, so pll->lpnFirst->lpnNext == 0xfeeefeee.
This of cause crashes in the loop
while (( lpp = ( LPPARSER )RemHead(( LPLIST )&pll )) != NULL )
I could not figure out, how a parser can be member of two lists. This is due to the fact, that you have internal and non-internal pools which get mixed in the same lists - very difficult to debug for someone else than the author
The Saviour of the World is a Penguin and Linus Torvalds is his Prophet.
|
|
|
|
|
ReorX wrote:
I could not figure out, how a parser can be member of two lists. This is due to the fact, that you have internal and non-internal pools which get mixed in the same lists - very difficult to debug for someone else than the author
Actually a parser should never be (and can't be) a member of two different lists. What the code does (or is supposed to do) is load the new settings files into a temporary list, add manually loaded parser files to this temporary list and free old parsers making the temporary list the main parser list. I am not behind my development machine right now so I can't test this yet but but it seems to go wrong with freeing the parsers and there is no default parser loaded. What you should try is the following change in the UpdateSettings() function:
while (( lpp = ( LPPARSER )RemHead(( LPLIST )&plParsers )) != NULL )
{
if ( lpp->bHasBeenAdded == TRUE )
AddTail(( LPLIST )&pll, ( LPNODE )lpp );
else
FreeParserNode( pMainPool, lpp );
}
change the else line to:
else if ( lpp != lpDefault )
Thanks for finding this one and my appologies for the bug hunt.
Enjoy,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
I changed the line, but now, upon leaving the "Keywords"-Dialog, I get into a non-terminating loop:
/*
* Copy the new situation.
*/
while (( lpp = ( LPPARSER )RemHead(( LPLIST )&pll )) != NULL )
AddTail(( LPLIST )&plParsers, ( LPNODE )lpp );
I'm sorry ...
Can you reproduce this or shall I post my bcl-configuration?
Regards, Jens
The Saviour of the World is a Penguin and Linus Torvalds is his Prophet.
|
|
|
|
|
First of all sorry for the late response. I have been away for a couple of weeks.
ReorX wrote:
I'm sorry ...
Can you reproduce this or shall I post my bcl-configuration?
Don't be sorry, if there is a problem in my code I should be sorry. Anyway I am currently having some trouble with my Visual Studio installation. As soon as I have that fixed I will have a closer look at this problem.
I would appreciate it if you could send me your settings files. No need to post them, simply email them to baard25(at)zonnet(dot)nl.
Bye,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
Has anyone been able to get the OCX working in VB6?
If so, any chance you could provide a basic sample?
|
|
|
|
|
What exactly are the problems you are having? If you install brainchild as explained in the article and you copy the OCX in the directory where brainchil.dll is located and you register the ocx (regsvr32.exe) all should be fine.
Bye,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
Hi Jan,
THe control looks great and it seems to do all I want for SQL scripts. My question is regarding using the control in VB6. If I understand it correctly, I need to do the following:
1. Create a folder C:\VBProject
2. Save the dll, cpl and ocx in this folder.
3. Copy the Defaults folder in VBProject folder.
4. Update the registry to point to the location of the Default Folder
5. Register the ocx control
6. Reference the control in teh VB project
7. Add the control to a Form.
At this point, how do I set the langauge to be SQL, set linenumbering to true, add bracematching etc.? Do I need to bring up the configuration editor? How can I do that?
The help file states
"The brainchild package includes next to the control itself also a program to configure brainchild. This program, when installed, will add an entry in your control panel called "Brainchild Configurator". With this program you can control the options and settings of the brainchild control."
While I can invoke the config editor from the demo program, I am not sure how to link the Configurator to the control on the Form in my VB6 application. Also, I do not see the configurator in the Control Panel.
Please suggest.
Thanks
Shakti
|
|
|
|
|
Shakti Goel wrote:
THe control looks great and it seems to do all I want for SQL scripts. My question is regarding using the control in VB6. If I understand it correctly, I need to do the following
1. Create a folder C:\VBProject
2. Save the dll, cpl and ocx in this folder.
3. Copy the Defaults folder in VBProject folder.
4. Update the registry to point to the location of the Default Folder
5. Register the ocx control
6. Reference the control in teh VB project
7. Add the control to a Form.
Actually you can do not need to copy the brainchild stuff into the VB project directory. You can copy it into it's own directory anywhere on your hard disk. You need update the registry to point to the settings folder in which the Defaults directory is located. I.E. if you have a directory structure like this:
C:\
Brainchild
Settings
Defaults
you should point the registry key to "C:\Brainchild\Settings". For the rest (registering, referencing etc.) should work as you described.
Shakti Goel wrote:
At this point, how do I set the langauge to be SQL, set linenumbering to true, add bracematching etc.? Do I need to bring up the configuration editor? How can I do that?
You do not need to do any setup to load SQL files. When you load a file into the control with the ".sql" file extention the control will automatically choose T-SQL highlighting. For extra settings like line numbering etc. you need to use the control panel applet.
Shakti Goel wrote:
The help file states
"The brainchild package includes next to the control itself also a program to configure brainchild. This program, when installed, will add an entry in your control panel called "Brainchild Configurator". With this program you can control the options and settings of the brainchild control."
While I can invoke the config editor from the demo program, I am not sure how to link the Configurator to the control on the Form in my VB6 application. Also, I do not see the configurator in the Control Panel.
Please suggest.
That line from the documentation is left over from the time brainchild still was distributed as an install package. This install package automatically installed the CPL into the system32 directory. If you want to be able to configure brainchild using the control panel you can copy the CPL and DLL in the System32 directory.
If you simply want to use the control panel applet from you VB application a simple call to the SettingsDialog() method of the OCX should suffice.
Enjoy,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
Thanks Jan.
I was able to make the control work in VB and it looks great!
Some questions I had while writing the code after incorporating the control were:
1. I have an UNDO menu item. It seems that multiple undos and redos are built in the Brainchild control. What code would I write to perform an undo operation when I click the UNDO menu item (or REDO for that matter)?
I can use the SendMessageLong win32 API Function but I need the handler (HWND property) for the control. Also, some controls have the UNDO and REDO methods exposed which can then be called directly in the program. I looked ath the cpp code for the demo [I am not a cpp progrogrammer ] but sort of figured out you are making a Windows call to perform undo, cut, copy etc.
2. It will be great to have some more properties built into Brainchild that generally come standard with RichTextBox control and are very useful. They are:
Locked - true or false : If locked then you cannot perform edit in the control
BackColor - sets the backcolor of the control
3. I did not find the _change event but I think _cursorposition method does that. Right?
I think it will help very much if undo and redo calls can be exposed in the OCX.
Awesome work!!
Thanks.
Shakti
|
|
|
|
|
Forgot to ask...
when you package the application and add the control to it, what steps need to be taken..
I can think of
1. Add the .OCX and .dll in the ditribution
2. Distribute the T-SQL.bcp
I am not sure how the registry key for settings will be done by the installer. If I understand it correctly, we need to set the registry so that the OCX knows where the TCP-SQL is?
If I use loadparser method then do I still need to go through the registry step?
Thanks
|
|
|
|
|
Shakti Goel wrote:
Forgot to ask...
when you package the application and add the control to it, what steps need to be taken..
I can think of
1. Add the .OCX and .dll in the ditribution
2. Distribute the T-SQL.bcp
I am not sure how the registry key for settings will be done by the installer. If I understand it correctly, we need to set the registry so that the OCX knows where the TCP-SQL is?
You indeed need to include the control add and OCX in the distribution. You will probably also need to register the OCx with regsvr32.
Shakti Goel wrote:
If I use loadparser method then do I still need to go through the registry step?
I honestly can't say at the moment. Brainchild should run now without having to do the registry thing and loading the BCP file using the LoadParser() method should suffice. Just try it. If it does not work let me know.
Bye,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
First of all my appologies for the late anwser. I have been away for a couple of weeks.
Shakti Goel wrote:
1. I have an UNDO menu item. It seems that multiple undos and redos are built in the Brainchild control. What code would I write to perform an undo operation when I click the UNDO menu item (or REDO for that matter)?
I can use the SendMessageLong win32 API Function but I need the handler (HWND property) for the control. Also, some controls have the UNDO and REDO methods exposed which can then be called directly in the program. I looked ath the cpp code for the demo [I am not a cpp progrogrammer ] but sort of
Calling Undo, Redo and quite a few other things can be accomplished through the ExecuteCommand() method of the OCX just pass it the ID of the command you want to execute. Look at the "brainchild_defs.h" file in the OCX sources to find the possible command codes. All defines starting with CID_ are valid for the ExecuteCommand() method. For Undo you would call:
ocxInstance.ExecuteMethod( 100 )
Shakti Goel wrote:
2. It will be great to have some more properties built into Brainchild that generally come standard with RichTextBox control and are very useful. They are:
Locked - true or false : If locked then you cannot perform edit in the control
BackColor - sets the backcolor of the control
Locked does not exist but you can set the control to readonly by setting the Readonly property. To change the background color of the control you can use the SetColor method. Use 1 (BCC_BACKGROUND in brainchild_defs.h) as the first parameter, the second parameter must be thr RGB value of the color to set.
Shakti Goel wrote:
3. I did not find the _change event but I think _cursorposition method does that. Right?
The controls fires several events. There is the OnCaretPosition event which get's fired when the caret (cursor) position changes. There is the OnStatusUpdate event which fires if the internal status of several flags change (see NMSTATUSUPDATE structure in brainchild_defs.h). Finally there is the OnFilenameChanged event which fires, like the name implies, when the filename has changed.
Enjoy,
Jan
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|