General discussion about plugins.

Browse, download and discuss plugins for Blumentals code editors

Re: General discussion about plugins.

Postby Aivars » Tue Jun 07, 2016 11:08 am

Features added in Build 185:

Fixes: Documents.TabByFileName is implemented now. keydown signal adds shift state parameter.

If Script.Message(...) outputs string containing a marker in specific format then doubleclicking this line in Messages pane will bring the cursor to the corresponding line.
Some samples that will work:
Code: Select all
Line 1
Line: 1
Line 1:2
Line: 1:2
some_error:1:2
"some error":1:2


New functions
Code: Select all
function DirectoryExists(Path: string): Boolean;
function DateSeparator:string
function TimeSeparator:string
function ShortDateFormat:string
function LongTimeFormat:string


TEdit and TMemo have new methods available:
Code: Select all
CopyToClipboard
PasteFromClipboard
SelectAll


New function CustomSortStringList. Sample:
Code: Select all
function TestSort(SL, i1, i2) {
    return -CompareText(SL[i1], SL[i2]);  //notice the "-"
}

function CreateTestMem() {
    var Mem = new TMemo(WeBuilder);
    var lala = new TStringList;
    Mem.Parent = WeBuilder;
    Mem.Visible = true;
    Mem.Width = 300;
    Mem.Height = 300;
    lala.Add("a");
    lala.Add("c");
    lala.Add("1");
    lala.Add("b");
    lala.Add("2");
    lala.Add("3");
    CustomSortStringList(lala, &TestSort);
    Mem.Lines.Text = lala.Text;
}
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: General discussion about plugins.

Postby pmk65 » Sun Jun 26, 2016 11:27 am

When using the "document_before_save" signal, is it possible to prevent the document from being saved?
I tried returning FALSE from the callback function, but it didn't have any effect.

I want to prevent saving if an error was found, so document only can be saved when there's no errors in code.
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: General discussion about plugins.

Postby Aivars » Sun Jun 26, 2016 9:33 pm

It's not possible to block saving from plugins normally. You could try to have the signal handler to throw an exception but I haven't tested this approach.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: General discussion about plugins.

Postby pmk65 » Tue Jun 28, 2016 11:21 am

Aivars wrote:It's not possible to block saving from plugins normally. You could try to have the signal handler to throw an exception but I haven't tested this approach.


No problem. I ended up using "document_after_save" instead.

Another question: Is it possible to see if the editor content have been changed since last save from plugin scripting?
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: General discussion about plugins.

Postby Aivars » Thu Jun 30, 2016 11:06 am

One way to do it for now would be to monitor "modified" signal.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: General discussion about plugins.

Postby Aivars » Thu Jun 30, 2016 11:08 am

Actually, couldn't you just use Editor.Modified or Document.Editor.Modified?
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: General discussion about plugins.

Postby anderson » Mon Aug 22, 2016 11:54 pm

Hello,

I'm having trouble developing a plugin to compile sass files. I need to run the following command with the ExecuteCommand function:

Code: Select all
"C:\ruby\bin\compass" compile 'C:\Apache24\htdocs\www.ingeniasoftware.com.ve\themes\default\'


And I get a blank error window:

Image

Here is my code:

Code: Select all
(...)

      var command = "\"C:\\ruby\\bin\\compass\" compile '"+dir+"'";
      var OutputText;
      ExecuteCommand(command, &OutputText);
     
      Script.Message(command);
      Script.Message(OutputText);

(...)


Is there any way to run this command directly from WeBuilder?

I tried it with ExecuteFile but do not want it to look that black terminal window

PS: It seems that the variable OutputText does not work either :(
Web developer and designer. Using WeBuilder since 2014.
User avatar
anderson
 
Posts: 13
Joined: Thu Jul 02, 2015 6:48 am
Location: Venezuela

Re: General discussion about plugins.

Postby pmk65 » Mon Aug 22, 2016 11:55 pm

Remove the ampersand (&) from the OutputText variable. Then it will work.

ExecuteCommand(command, OutputText);
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: General discussion about plugins.

Postby anderson » Tue Aug 23, 2016 12:23 am

** SOLVED **
You MUST add the file's extension (in my case, i need to use the .bat compass file) Thanks for the help pmk :D, example:

Code: Select all
var command = "\"C:\\ruby\\bin\\compass.bat\" compile '"+dir+"'";

---

It does not work, still sending error messages (now in Chinese) :shock:

Image

Image
Web developer and designer. Using WeBuilder since 2014.
User avatar
anderson
 
Posts: 13
Joined: Thu Jul 02, 2015 6:48 am
Location: Venezuela

Re: General discussion about plugins.

Postby pmk65 » Tue Aug 23, 2016 9:49 am

Try taking a look at my "Node-Sass" plugin. It uses ExecuteCommand too.
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: General discussion about plugins.

Postby pmk65 » Fri Sep 30, 2016 1:51 pm

I have noticed that the GUI of plugins doesn't always have the same size on virious systems.
A good example is the Project Manager plugin by dave.

On my old Windows 7 system everything was aligned properly, but on Windows 10, the labels are longer and partly hidden behind form fields. (See screenshot)

Do you have to specify font/size for each form element in order to achieve consistency between systems?

Image
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: General discussion about plugins.

Postby pety » Sat Oct 01, 2016 11:56 am

What kind of [Project Manager] is that?
Is it a downloadable plugin?
pety
 
Posts: 187
Joined: Fri Mar 02, 2012 7:17 pm

Re: General discussion about plugins.

Postby dave » Sun Oct 02, 2016 3:41 pm

The plugin was created in Windows 7. Perhaps Windows 10 has a different default on screen font? Different as in different size?
dave
 
Posts: 24
Joined: Fri Mar 31, 2006 2:45 pm

Re: General discussion about plugins.

Postby pmk65 » Mon Oct 03, 2016 12:57 pm

dave wrote:The plugin was created in Windows 7. Perhaps Windows 10 has a different default on screen font? Different as in different size?


I have the same problem with some of my plugins. But your Project Manager GUI was the best to illustrate the problem. :D
So if it's the system font that is used, maybe it would help if we specify a font/size for each form element?

Aivars, do you have any solutions for this problem?
Would specifying a font/size help? And should you set it on each form element or can you set it at the form definition?
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: General discussion about plugins.

Postby Aivars » Tue Nov 01, 2016 11:34 am

I'll look at the text zooming issues. Could you try if setting myform.Scaled = true or false helps?
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

PreviousNext

Return to Plugins for HTMLPad / Rapid CSS / Rapid PHP / WeBuilder

Who is online

Users browsing this forum: No registered users and 6 guests