Source language: Translate to:

hpwPlusMemo

Questions about NeoBook PlugIns

Moderator: Neosoft Support

Re: hpwPlusMemo

Postby HPW » Mon Mar 09, 2015 2:42 pm

Hello,
Comment char is set in the ini:
[Settings]
commentchar=!
Hans-Peter
User avatar
HPW
 
Posts: 2516
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpwPlusMemo

Postby mishem » Mon Mar 09, 2015 3:14 pm

Hello!

It is mostly difficult to guess what you want.


I want to make a program that the user can create a regular expression to plug hpwControl.
That he could see visually what he does.

hpwExecRegExpList searches for matches and displays an error if any.
hpwPlusMemo shows (highlights) matches found.
While I did not get to synchronize these two plugins.

Something like this ...

..............Rus..................
Я хочу сделать программу чтобы пользователь мог составить регулярное выражение для плагина hpwControl.
Чтобы он визуально мог видеть что делает.

hpwExecRegExpList ищет совпадения и отображает ошибки если такие есть.
hpwPlusMemo показывает (подсвечивает) найденные совпадения.
Пока у меня не получается синхронизировать эти два плагина.

Как то так...
mishem
 
Posts: 575
Joined: Mon Oct 08, 2012 1:51 pm

Re: hpwPlusMemo

Postby mishem » Mon Mar 09, 2015 4:13 pm

Made an example of what I want.

Download.

It is necessary that the editor has been allocated the same as indicated in the matches found:...
Line RegEx: sends the string configuration

Code: Select all
SetVar "[TextForRegex]" "[#91]RegExKeywords[#93][#13][#10][Regex_Text]=1,0,1,0,-1,16711680,0,0,"
hpwPlusMemoLoadCfg "TextForRegex" "[TextForRegex]"


If you click on the button << >>, it will be allocated matches found hpwExecRegExpPos.
It is necessary to found and hpwExecRegExpPos hpwExecRegExpList coincided with dedicated editor.

Something like that.


///////////////////////

Comment char is set in the ini:


I load variable, not a file. I do not have these sections. Loading only

Code: Select all
SetVar "[TextForRegex]" "[#91]RegExKeywords[#93][#13][#10][Regex_Text]=1,0,1,0,-1,16711680,0,0,"
hpwPlusMemoLoadCfg "TextForRegex" "[TextForRegex]"


Still, all that is of the semicolon; until the end of the line in a different color. See. Screenshot above.
mishem
 
Posts: 575
Joined: Mon Oct 08, 2012 1:51 pm

Re: hpwPlusMemo

Postby HPW » Tue Mar 10, 2015 4:55 am

Hello,

First i have to check if loading from variable is supported in hpwPlusMemoLoadCfg.
The wizard says that the variable should contain a file-name.

So here migth be the problem.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2516
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpwPlusMemo

Postby HPW » Tue Mar 10, 2015 9:05 am

Hello,

All settings have a default value on which it fallbacks when nothing given.
So why not add the commentchar to your ini-stream:

Code: Select all
SetVar "[TextForRegex]" "[#91]RegExKeywords[#93][#13][#10][Regex_Text]=1,0,1,0,-1,16711680,0,0,[#13][#10][#91]Settings[#93][#13][#10]commentchar=!"
hpwPlusMemoLoadCfg "TextForRegex" "[TextForRegex]"


As long you produce a valid ini-stream it is the same as loading from file.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2516
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpwPlusMemo

Postby mishem » Tue Mar 10, 2015 12:30 pm

First i have to check if loading from variable is supported in hpwPlusMemoLoadCfg.

Supported. I posted above example. Download and see. There's only the main code.

So why not add the commentchar to your ini-stream:

I've tried. If the symbol is there, there are several problems. It is certainly possible to get around and check the existence of a symbol in the text, and to substitute the one which is not.

Thank you for your answers and for plug-ins. I am still experimenting.
mishem
 
Posts: 575
Joined: Mon Oct 08, 2012 1:51 pm

Re: hpwPlusMemo

Postby stu » Fri Mar 27, 2015 6:25 am

I would like to store code snippets on a small database for my personal use and I was thinking of syntax highlighting to make it more shiny... Is there a TSQL or SQL file for syntax highlighting?
User avatar
stu
 
Posts: 320
Joined: Wed Aug 07, 2013 11:37 am

Re: hpwPlusMemo

Postby HPW » Fri Mar 27, 2015 8:30 am

Is there a TSQL or SQL file for syntax highlighting?


Not ready made.
But you may have a look at the example config files.
When you have a keyword list of your languages it should be simple to create your own config file.
And you can use the contained KeyWordEdit.exe to build config files with a GUI-tool.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2516
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpwPlusMemo

Postby stu » Fri Mar 27, 2015 9:38 am

Ok, thats cool... I started my SQL ini file and I have the problem of highlighting things like:

SELECT * FROM tblTest WHERE (field_one = 1) AND (field_two LIKE 'something')

I need everything in between single quote to be from a color. I see the StartStopKeyEdit but it wont work for the same character. Any chance of accomplish this?

Cheers.
User avatar
stu
 
Posts: 320
Joined: Wed Aug 07, 2013 11:37 am

Re: hpwPlusMemo

Postby HPW » Fri Mar 27, 2015 12:20 pm

A regex might work:
Code: Select all
[RegExKeywords]
^'.*'$=0,0,1,0,-1,255,0,0,


This regex need a word boundery before and after the string:
So 'Test' work but 'Test') will also Color the closing paranthese. But you may add a space: 'Test' )
Not sure if other regex might work better.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2516
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpwPlusMemo

Postby HPW » Fri Mar 27, 2015 12:41 pm

Seems I make a mistake:
I tested in paralel a StartStopKey and this seems to do it:
Code: Select all
[Sections]
'|'=1,0,3,0,-1,16711680,3,0,0,

So not the regex.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2516
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpwPlusMemo

Postby stu » Sun Mar 29, 2015 8:52 am

HPW wrote:Seems I make a mistake:
I tested in paralel a StartStopKey and this seems to do it:
Code: Select all
[Sections]
'|'=1,0,3,0,-1,16711680,3,0,0,

So not the regex.

Regards


Awesome, thanks for your help!
User avatar
stu
 
Posts: 320
Joined: Wed Aug 07, 2013 11:37 am

Re: hpwPlusMemo

Postby HPW » Sat Jul 11, 2015 11:57 am

Hello,

I was asked how a hotspot is defined in PlusMemo:

In your keyword config give the wanted hotspot keyword a unique content id.
Here it is the 10 in third param.

define=2,0,10,-21,-1,16711680,0,0,

With the -21 in fourth param you tell plusmemo to show the Hand-Cursor when mouse over the keyword. (See MouseCursor.txt for possble Cursor)

See page-Action the Content of "[RPlusMemo1_ContextAction]":
Code: Select all
hpwPlusMemoSetVar "[RPlusMemo1_ContextAction]" "If [#34][#91]RPlusMemo1_ContextNum[#93][#34] [#34]=[#34] [#34]10[#34][#13][#10]  AlertBox [#34]ContextAlert[#34] [#34]Context: [#91]RPlusMemo1_ContextNum[#93] = [#91]RPlusMemo1_ContextStr[#93][#34][#13][#10]Endif"


The context-action is fired when you click in plusmemo-text. With the returned context-id you can check if this keyword is used as a hotspot and fire the wanted action. Alternativly you can check the string in RPlusMemo1_ContextStr.

Hope this helps.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2516
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpwPlusMemo

Postby HPW » Sun Jul 12, 2015 3:30 am

Just released hpwPlusMemo 1.11:

http://www.hpwsoft.de/anmeldung/html1/n ... ook16.html

New variable [RectangleName_InternalPopupCaption0] for setting caption-text of 'Undo' in internal popup-menu.
New variable [RectangleName_InternalPopupCaption1] for setting caption-text of 'Redo' in internal popup-menu.
New variable [RectangleName_InternalPopupCaption3] for setting caption-text of 'cut' in internal popup-menu.
New variable [RectangleName_InternalPopupCaption4] for setting caption-text of 'copy' in internal popup-menu.
New variable [RectangleName_InternalPopupCaption5] for setting caption-text of 'paste' in internal popup-menu.
New variable [RectangleName_InternalPopupCaption7] for setting caption-text of 'select all' in internal popup-menu.
The new variables allows translation into other languages.

Bugfix: Wizard of hpwPlusMemoSetVar was throwing access violation sometimes.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2516
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpwPlusMemo

Postby HPW » Mon Jul 13, 2015 4:10 am

Just released hpwPlusMemo 1.12:

http://www.hpwsoft.de/anmeldung/html1/n ... ook16.html

Action: hpwPlusMemoActivatePopup - Activate/setup a custom popupmenu of the memo.
Action: hpwPlusMemoSetPopupItem - Set different propertys of a popup item.

Usefull when other entrys are needed as in the internal popup-menu. Similar to the popup in hpwImage.
Demo in page 2 of sample pub.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2516
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

PreviousNext

Return to PlugIn Discussions

Who is online

Users browsing this forum: No registered users and 0 guests