Tuesday, May 8, 2012

SynMiniMap updated to v. 1.1

SynMiniMap has been updated, update or get it by clicking here.

The new version carries a few fixes and enhancements:

  • editor scroll using MiniMap(normal|reversed)
  • ability to override tab width, by default it will grab the editor's tab width, now you can override it and set it to 4 for example, very useful if editing html and suffering from div-itism
  • a few new properties inherited from TCustomControl

  • flickering when scrolling "too many" lines at once
  • >
  • line calculation on click, Sublime Text doesn't have the option(or at least I'm not aware) to click on a line and automatically move the caret on it, SynMiniMap passes the line and char in the event data of the OnClick event

known issues: <
  • if you've assigned the OnClick event, the "char" value passed in the event data is not always correct, needs fix, but it's not wrong by far, so, you can set the CaretX or not, but at least you can go to the correct line on click (:

There are no other notable changes, however, if you find it useful, and make fixes, enhancements, please consider sending it back so that others can benefit from it.


I want to be clear on this, the license is Apache 2.0 because I think it's the most flexible one available on Google Code, however, whatever restrictions you may find in it, please don't take it into consideration, if you wish to contribute to the project then excellent, if not, there's no biggie, you can use the source as you wish, commercial, private, etc.

If you find bugs or want to request enhancements, please use the google code Issue Tab or e-mail me directly at duminicadorin at google's mail dot com (:


Saturday, May 5, 2012

SynMiniMap or Sublime Text minimap ripoff

Some time ago, I've heard about Sublime Text, outstanding tool!

One of the things I like most about it, is the minimap, which is a scaled down version of the file which will help you have a bird's eye view of the file, this means that you can see somewhere between 100 and 200 lines in the minimap, while the text editor can only display about half of what the minimap can at best.

I've started thinking, wouldn't it be cool if there was something like that for SynEdit? googled-googled-googled, nada... okay, that kinda' sux... synedit is around for many years... oh well, started coding and here's the result(this is a screenshot of the included demo)

minimap demo
You can find the code at http://code.google.com/p/delphigeist-delphi-stuff It also includes a simple tabbed demo. Suggestions and bug fixes are welcomed!
The code is under apache license 2.0, whatever that means... if anyone can suggest the most "freely" license possible, I'm willing to change it.

Tuesday, May 1, 2012

Delphi-like MessageDlg in Javascript with jQuery

As you may already know, the good old MessageDlg function in Delphi is not available for web applications, so you're done to a few options: I've created my own MessageDlg function that is very close to the Delphi function, however, the dependencies are jQuery and jQuery UI
function MessageDlg( text, type, buttons, callback ) {
  /* code */
  • text: text to be displayed
  • type: dialog type, i.e. Information, Confirmation, Warning, Error
  • buttons: array of button types to be added on the dialog, ala delphi, i.e. [mbOK, mbYes, mbNo]
  • callback: function to be called when the user clicks a button, the function gets a integer parameter passed which is equal to the button type, i.e. mbOK = mrOK
Here's the code: filename.js

as you can see, the core of the function doesn't require that much code, however, I've added a few effects here and there to make it more eye pleasing and to be flexible, now the css part: filename.css

that's quite a bit of css for something so simple that could have been achieved using a table element, but hey, it works, also, it allows you to tweak things the way your heart dictates. Checkout http://code.google.com/p/delphigeist-javascript-stuff/ for code and other future stuff.

Blogroll(General programming and Delphi feeds)