Author Topic: Code templates in Completion List box >> non-printable char  (Read 2911 times)

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 772
  • Karma: +6/-0
    • View Profile
Code templates in Completion List box >> non-printable char
« on: March 02, 2009, 10:51:41 pm »
Quote
Version 617:
    * New. Code templates now can be shown in Completion List box.
       Controlled by flag Options->Code Completion->Show in completion list->Code Templates

"Code templates" have an trailing non-printable char visible in the "Completion List box"

Seen with 620-622
See picture ===>http://forum.hippoedit.com/index.php/topic,204.msg723.html#msg723
Stefan, HippoEDIT beta tester  (HippoEDIT News On Twitter: http://twitter.com/hippoedit/)

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1666
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Code templates in Completion List box >> non-printable char
« Reply #1 on: March 03, 2009, 12:09:32 pm »
Hello Stefan,

thanks, I can reproduce. But not on all PCs...
At home I do not see tab after text, only at work... Strange. Would fix next beta.

Best regards,
Alex

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 772
  • Karma: +6/-0
    • View Profile
Re: Code templates in Completion List box >> non-printable char
« Reply #2 on: March 03, 2009, 09:40:18 pm »
622
Just an minor issue:

I have add an code template.

If i later modify the description, the display of this new description is not visible in options > syntax > code templates.
My Description was "If Then Else"
Later i modify them to "If Then Else Alex"

The modification is stored. OK.
But the view is not updated in the options dialog. (see picture)
If i restart HE the modification is visible in the options dialog too.
« Last Edit: March 03, 2009, 09:42:27 pm by Stefan »

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 772
  • Karma: +6/-0
    • View Profile
Re: Code templates in Completion List box >> non-printable char
« Reply #3 on: March 03, 2009, 10:08:57 pm »
I want to make an pseudo intellisense feature  (http://en.wikipedia.org/wiki/IntelliSense)

and add this as description:

"MsgBox(prompt[, buttons][, title][, helpfile, context])"

This is shown as tooltip but not executed and not stored.


Is there an other possible way to store and view an tooltip for an keyword  to implement an pseudo intellisense feature ?


Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1666
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Code templates in Completion List box >> non-printable char
« Reply #4 on: March 04, 2009, 01:40:43 am »
Hi Stefan,

could not reproduce problem with description... In my case everything correctly updated... I have tried to edit already existing template.
Please recheck with newest beta (just uploaded). Also you can check thee a new feature Nesting Levels in View->Editor menu ;)

About the QuickInfo ("MsgBox(prompt[, buttons][, title][, helpfile, context])")
Do you want to have this:
Quote
This is shown as tooltip but not executed and not stored.
or you have complained ? ;)

Generally I have understood, but would like to have more input from you.
As idea, currently you can have a patterns for keywords when inserting (check php_spec.xml). It is mostly the same as template.
And you can defined it as for group as for specific keyword. The same can be done probably for description, and then show it as tooltip on hover or Ctrl+Shift+Space. Only I am afraid that this can slow down a loading speed for schemas with a lot of keywords, when used.

Best regards,
Alex

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 772
  • Karma: +6/-0
    • View Profile
Re: Code templates in Completion List box >> non-printable char
« Reply #5 on: March 04, 2009, 07:28:20 am »
> problem with description
i will check again



> About the QuickInfo ("MsgBox(prompt[, buttons][, title][, helpfile, context])")
I have tried to use this.
Putting   >>> MsgBox(prompt[, buttons][, title][, helpfile, context]) <<<  as description and code, like my pic shows.
But i was not able to insert this piece of code.
And this code template was not stored in user.xml.
I thought this is because of all those '(' and '[' ?
I will test if i am awake.



>Do you want to have this:
>>This is shown as tooltip but not executed and not stored.
No! i don't want this.   This was only what i have seen and makes me wonder, so i mentioned it.



>(check php_spec.xml)
i will check and think about.


Thank you
CU

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 772
  • Karma: +6/-0
    • View Profile
Re: Code templates in Completion List box >> non-printable char
« Reply #6 on: March 04, 2009, 05:56:50 pm »
>(check php_spec.xml)
i will check and think about.



>As idea, currently you can have a patterns for keywords when inserting (check php_spec.xml).
>It is mostly the same as template.
>And you can defined it as for group as for specific keyword.
>The same can be done probably for description, and then show it as tooltip on hover or Ctrl+Shift+Space.

I don't understood what this means, sorry.

I think what i dreaming about is an optional tool tip for written text and code hint dialog

for keywords:
<Keyword text="MsgBox" Tooltip=""MsgBox(prompt[, buttons][, title][, helpfile, context])"/>
<Keyword text="mail"/>
<Keyword text="max"/>

and code templates:
<Template key="DoLoop" descr="Do Loop">Do While {condition}\n\t{statements}\nLoop</Template>



If i now hoover with cursor
over word in code hint dialog
or over an written text...

... i want to see an tooltip from tooltip-part of keyword
or an tooltip from code-to-insert part of code template (with \n line breaks expanded)
(OK, codeTemplates-ToolTips make sense only for dialog, i guess ;-) )

Would be nice if i can set the timing, f.ex. set 5sec to display the tooltip, and display it for 6sec

I think that way i can get an easy help to get an knowledge what this keyword/template is for
and what arguments/options/syntax they have. Kinda IntelliSense light.



--
what gives me the next idea: pseudo-keywords

I want to have "MBprompt", "MBbuttons", "MBtitle" and so on as pseudo keywords to only display the tooltips.

So i can paste this f.ex.:
MsgBox(MBprompt[, MBbuttons][, MBtitle][, MBhelpfile, MBcontext])

 and would get tooltips for "MBButtons" if i hoover them.


---
also
1.) Tooltip and support for code templates for f.ex. "MsgBox(prompt[, buttons][, title][, helpfile, context])"
2.) Tooltip for keywords
3.) Pseudo-Keywords to have tooltips for words they are not real keywords.


There is a change i didn't make myself clear.
« Last Edit: March 04, 2009, 06:00:10 pm by Stefan »

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1666
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Code templates in Completion List box >> non-printable char
« Reply #7 on: March 04, 2009, 06:35:25 pm »
Hello Stefan,

Quote
1) Tooltip and support for code templates for f.ex. "MsgBox(prompt[, buttons][, title][, helpfile, context])"
I think you can live and without tooltips for templates in dialog ;) Single click on list line shows you exapanded code of the template. Ok, tags are not expanded, but this is ok, it is not realy necessary to have them expanded there...

Quote
2.) Tooltip for keywords
This would come next beta in form of:
Code: [Select]
<Keyword text="MsgBox" pattern="%CurrentWord%(%EnterParameters%)%|%" descr="MsgBox(prompt[, buttons][, title][, helpfile, context])"/>. What I mean under check php_spec, was that there already was used pattern attribute for all function keywords (on <Keywords pattern="%CurrentWord%(%|%)"). Then text from descr would be shown on Ctrl+Shift+Space. It is already assigned to command QuickInfo (check keyboard map) but was not used in stadalone editor. Was designed for activex usage of HE. I would also bring back properties for QuickInfo: Display on Hover and Enable. I think time is also configurable, at least in XML.

Quote
3.) Pseudo-Keywords to have tooltips for words they are not real keywords.
This would be available automatically. What you need to do, is to add this keywords to style normal, as I have suggested you for user dictinary request, in schema where you need it, and give description to it.

P.S: The beta would be available today everning, if nothing happens :)

Best regards,
Alex.



Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 772
  • Karma: +6/-0
    • View Profile
Re: Code templates in Completion List box >> non-printable char
« Reply #8 on: March 05, 2009, 12:54:31 pm »
Is something done with 626?
I see some syntax xml are modified.

>Single click on list line shows you exapanded code of the template.
Oh, fine thanks (take an second to display,... but OK)


> 2.) Tooltip for keywords
What must i do that this works?


>What I mean under check php_spec,
This is not implemented right now, right?

>add this keywords to style normal,
At least i have now understood this little thing (which is great) ==> http://forum.hippoedit.com/index.php/topic,138.msg760.html#msg760

.

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 772
  • Karma: +6/-0
    • View Profile
Re: Code templates in Completion List box >> non-printable char
« Reply #9 on: March 05, 2009, 01:22:15 pm »
I get keyword ToolTip to work. (see pic)

-- Modify  syntax xml and add
 <Keyword text="MsgBoxx" pattern="%CurrentWord%(%EnterParameters%)%|%" descr="MsgBox(prompt[, buttons][, title][, helpfile, context])"/>

-- Restart HippoEDIT
-- Open an doc with your syntax
-- type keyword, here "MsgBoxx"
-- put cursor inside keyword
-- press Ctrl+Shift+Space and read the tooltip


Thank you Alex

.
.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1666
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Code templates in Completion List box >> non-printable char
« Reply #10 on: March 05, 2009, 02:07:24 pm »
No, problem ;)

Just now writing description of the changes in 626.

Settings can be found in Options->Code Completion.
If you would add the parameters to sb/basic schema, I would be glad to update also installed version ;) If you would send me your version.

I have also in todos parsing of the tip string correctly, so you can get description for parameters, but this would be done some when later...

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 772
  • Karma: +6/-0
    • View Profile
Re: Code templates in Completion List box >> non-printable char
« Reply #11 on: March 05, 2009, 08:35:29 pm »
>Dont forget also about pattern property: with it you can specify, how keyword should be inserted by code completion.
>You can also use template tags inside. %CurerntWord% tag in this context mean keyword text.

 pattern="%CurrentWord%(%EnterParameters%)%|%"

Pattern means i can execute an 'code template'  while i insert an keyword in document?

I see i  can even use:
 pattern="%CurrentWord%(%Prompt%,%buttons%,%title%)%|%"

Great.

----

Is there an option to pre-fill the parameter-history-list? For have this in the drop-down list of para-dialog.

Like
<HistPreFill bbbbuttons="vbOK,vbCancel,vbYes,vbNo"/>

This  bbbbuttons   'keyword'   i would use  as interactive para name %bbbbuttons%


The drop-down should show first the last used history items followed by the PreFill list.




EDIT:  this feature could perhaps be add like an new %interactive% token for code templates too.
Like %InteractiveList%{one;two;three}

So i can use
Key: #k
Descr: test
code: %InteractiveList%{one;two;three}

and if i type '#k' i get the para box where i can choose one para from list to insert it.

Hmm, yes.  Again, like an pre-filled history list.


-----

Oh, so many to discover and so little brain.  I will toke me some time to get this all.
« Last Edit: March 05, 2009, 08:51:29 pm by Stefan »

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1666
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Code templates in Completion List box >> non-printable char
« Reply #12 on: March 05, 2009, 11:31:48 pm »
Hello Stefan,

the selection list is a good idea. I have it in my to do already. The best handling of such remplates I seen was in Intype. But probably, the same would be in e-text editor bundles..

There are a lot of things are missing in templates... I have also seen implmentation in PSpad, where you can define complete dialogs in templates.

Would try to implement in future versions, but do not know when. I think it is better to collect all requrements, check, what is should be done in templates, what as script, think about architecture and only then implement. Otherwise you bring incomplete solution, and need to support it later, even if it done wrong...

BTW: xml is selected as format for schemas, because of the standard format for strucured data. You have a lot of parsers implemented (for example in C++ and PHP), you should not think which characters are allowed and what should be escaped - this is work of parser. You have aggregations, encoding support. You can use browser for display and transformations. If you use your proprietary format - all this benefits that you do not have and need to develop by yourself.

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 772
  • Karma: +6/-0
    • View Profile
Re: Code templates in Completion List box >> non-printable char
« Reply #13 on: March 10, 2009, 05:13:26 pm »

If you would add the parameters to sb/basic schema, I would be glad to update also installed version ;)
If you would send me your version.

I had today some minutes to try this.
Did we talk the same?



basic_spec.xml
Code: [Select]
      <Style id="functions" name="Functions" image="12" bold="0" italic="0" underline="0" clr="Keyword3" bkclr="#FFFFFFFF">
        <Keywords>
          <Keyword text="Array" descr="MyArray(0) or MyArray(element_1, element_2, ...)"/>
          <Keyword text="CBool" descr="CBool(expression) - converted to Boolean. 'If expression is zero, False is returned; otherwise, True is returned"/>
          <Keyword text="CByte" descr="CByte(expression) - converted to Byte"/>
          <Keyword text="CCur" descr="CCur(expression) - converted to Currency"/>
          <Keyword text="CDate" descr="CDate(expression) - Converts a valid date and time expression to the variant of subtype Date"/>
          <Keyword text="CDbl" descr="CDbl(expression) - converted to Double"/>
          <Keyword text="Count" descr="Returns the number of items in a collection or Dictionary object. Read-only"/>
          <Keyword text="CStr" descr="CStr(expression) - Converts an expression to a variant of subtype String"/>
          <Keyword text="InputBox" descr="InputBox(prompt[, title][, default][, xpos][, ypos][, helpfile, context])"/>
          <Keyword text="LBound" descr="LBound(array) - Returns the lower bound of the specified array"/>
          <Keyword text="LCase" descr="LCase(string) - Returns a string that has been converted to lowercase"/>
          <Keyword text="MsgBox" descr="MsgBox [(] prompt[, buttons][, title][, helpfile, context] [)]"/>


I was able to enter an 1000 chars long descr with many \n's


Code: [Select]
<Style name="normal" image="13" bold="0" italic="0" underline="0" clr="Keyword" bkclr="#FFFFFFFF">
        <Keywords>
        <Keyword text="prompt" descr="text (in quotes) to prompt the user"/>
        <Keyword text="buttons" descr="vbOKOnly              0 Display OK button only.\n vbOKCancel            1 Display OK and Cancel buttons.\nvbAbortRetryIgnore    2 Display Abort, Retry, and Ignore buttons.\n
vbYesNoCancel         3 Display Yes, No, and Cancel buttons.\nvbYesNo               4 Display Yes and No buttons.\nvbRetryCancel         5 Display Retry and Cancel buttons.\nvbCritical           16 Display Critical Message icon.\n
vbQuestion           32 Display Warning Query icon.\nvbExclamation        48 Display Warning Message icon.\nvbInformation        64 Display Information Message icon.\n\nvbDefaultButton1      0 First button is default.\n
vbDefaultButton2    256 Second button is default.\nvbDefaultButton3    512 Third button is default.\nvbDefaultButton4    768 Fourth button is default.\n\nvbApplicationModal    0 Application modal;\n
vbSystemModal      4096 System modal; \n\nReturn Values:\nvbOK      1 OK\nvbCancel  2 Cancel\nvbAbort   3 Abort\nvbRetry   4 Retry\nvbIgnore  5 Ignore\nvbYes     6 Yes\nvbNo      7 No"/>
        </Keywords>
      </Style> 


Can you told your tool tip engine
to show the tip above or below the cursor-position,
related where the cursor is on screen?

If i wrote the keyword  near the top screen, my very high tool tip (the 1000 chars one) is shown half only. (see picture)
This is just an question. I can make my tool tip double the width and half the height ?!?
« Last Edit: March 10, 2009, 05:15:32 pm by Stefan »

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1666
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Code templates in Completion List box >> non-printable char
« Reply #14 on: March 10, 2009, 06:37:02 pm »
Hello Stefan,

probably this is a bug. I would also expect that if there is no enough space on top, tooltip should be shown on bottom... Or somewhere :)
I would try to fix thios soon.

By the way, I think there is also some minimal formatting possible for tooltips.
  • \b some text \b0 - make some text bold
  • \i some text \i0 - make some text italic
  • \l some text - align text to the left on the line
  • \c some text - center text on the line
  • \r some text - align text to the right on the line

 

Related Topics

  Subject / Started by Replies Last post
2 Replies
910 Views
Last post March 04, 2009, 10:52:43 pm
by Stefan
1 Replies
409 Views
Last post February 04, 2009, 12:30:32 pm
by alex
5 Replies
695 Views
Last post February 15, 2009, 04:28:32 pm
by alex
6 Replies
838 Views
Last post November 12, 2009, 03:37:48 pm
by Stefan
1 Replies
268 Views
Last post June 19, 2010, 08:38:17 pm
by alex