JMG Alpha 008

- 2016.10.28 (alpha 008):

 added: setWidgetSize() function. Allowed parameter values are 
        'small' and 'normal'. This is a global setting.

 added: setLabelPos() function. Allowed parameter values are 
        'left' and 'top'. This function set the position of 
        widget's labels. The default is top.
        This is a global setting.

 fixed: selectRow/unSelectRow does not change table color.

 fixed: bug (introduced in alpha 007) setting initial 
        values at 'select' widget creation.

 fixed: bug (introduced in alpha 007) set value 
        property on 'radio' widget (runtime).

You can download at: https://sourceforge.net/projects/jmg/files/

Remember that you can easily convert any JMG app (ie: the main demo) into an Android app, using website2apk:

https://sourceforge.net/projects/website2apk/

Enjoy!

Posted in Uncategorized

JMG Alpha 007

I’ve published a new JMG release:

- 2016.10.26 (alpha 007):

 added: 'div' widget. The <div> tag is used to define a division or 
        a section in an HTML document. Basically, it is usefull to 
        allow you to put your HTML code there.

 added: setPageWidth() function. Set maximun page width (useful 
        for desktops).

 modified: new optional parameter for beginPage() function. if it 
           is set to 'dialog', the page is shown as a dialog window.

 modified: 'radio' widget. For set and get, zero value, means no 
           intems selected.

 modified: 'select' widget. For set and get, zero value, means no 
            intems selected.

You can download at: https://sourceforge.net/projects/jmg/files/

Remember that you can easily convert any JMG app (ie: the main demo) into an Android app, using website2apk:

https://sourceforge.net/projects/website2apk/

Enjoy!

Posted in Uncategorized

TUNING HMG: HELP!

INTRO:

This post about a little and trivial thing (already reported to HMG developers).

Mmm… little and trivial?… deserves it a post?… YES!!!… I’ll explain why… lets go!

THE PROBLEM:

Again… I’m thinking (specially) in new HMG users and their experience.

Being new to HMG, one of the first things that you’ll gonna do, is to review the documentation.

It includes a nice text-input along with a button labeled ‘Search’.

As you could imagine its purpose is to search the documentation… YOU ARE WRONG!… IT DOES NOTHING! 🙂

THE HISTORY:

This search ‘feature’, resulted to be problematic for many users, reporting incompatibility with some anti-virus software, slowness and other problems that could even to impede them to use the help docs.

So, it was decided to disable it… GOOD DECISION!.

The problem is that the text-input and the search button still being here… driving us to… ‘The Problem’ 🙂

FIXING IT?

Mmm… (again)… IMHO (I could be wrong!) this ‘feature’ should be reconsidered from the scratch, since, because its design, it could be very very difficult to solve the problems reported by the users.

Besides that, it is not a real full-text search, but an indexed search based on some few keywords, ‘hard-coded’ on a JS function, meaning that its utility is very limited.

THEN?

I’m a little obsessive and I get easily disturbed by non-working things and this is a very notorious non-working thing 🙂 .

So, I’ve simply removed the text-input and the non-working search button from documentation.

Despite my obsessive neurosis, think again in ‘The Problem’: A new user trying to search something on documentation, repeatedly clicking the search button with no results… NOT GOOD!

WANT TO REMOVE THIS ‘FEATURE’?:

You must replace ‘navigator.html’ file, located at \doc\data sub-folder of your HMG3.4.3 installation.

You can get the fixed file (Navigator.htm.7z) from here

WANT TO TALK ABOUT THIS?

If you want to discuss about this (even to disagree with me🙂 ) you ca do it here (you need a SourceForge account to be able to post).

IMPORTANT NOTE (Déjà vu):

The problem described here, was already posted to HMG developers and it will be fixed in the next versions (at the time of this writing version is 3.4.3).

Posted in Uncategorized

TUNING HMG: THE SAMPLES HELL :)

Once upon a time… HMG samples were all together in an unique folder called SAMPLES.

Each sample had its own sub-folder. The name of each sub-folder was related to the main concept that the sample is aimed to show.

Simple… extremely simple…

One fine day, was decided that the samples should be grouped on categories… not a bad ideaIS A VERY GOOD IDEA INDEED, the problem is that, it was WRONGLY EXECUTED.

I’ll explain some few of the errors here (it is important to note that, this is not a subjective matter, this is about facts):

  • \SAMPLES\HFCL\SQL\RDD_SQL:
    RDD_SQL example was adapted by me, from a Harbour contribution. It is not related with HFCL.
  • \SAMPLES\HFCL\SQL:
    There is, in this folder, a file called HMGSQLite.zip, that appears to have the HMGSQLite example that already is on its own folder at the same location.
  • \SAMPLES\HFCL\MYSQL:
    At this folder, there is three MySql samples called MYSQL_1,MYSQL,2 and MYSQL_3 that (as the others mentioned) are not related with HFCL. They were created years prior to HFCL.
  • \SAMPLES\HFCL\POSTGRESQL_1:
    Again… not related with HFCL.
  • \SAMPLES\FUNCTIONS\SYSTEM_OBJECT’:
    sample is located there… but, there is no reason for that, since it is about system object, not HMG functions
  • \SAMPLES\CONTROLS\CURSOR:
    ‘Cursor’ IS NOT A CONTROL (but a Window property). It is that little thing on the screen that moves when you move the mouse 🙂
  • \SAMPLES\CONTROLS\DLL:
    CallDll’ is a function NOT A CONTROL!
  • \SAMPLES\CONTROLS\GRAPH:
    These samples are about GRAPH commands/functions. These are NOT CONTROLS!
  • \SAMPLES\CONTROLS\OLE:
    NOT A CONTROL!!! (This is handled via the CreateObject() function)
  • \SAMPLES\CONTROLS\PRINT:
    NO NO NO!!!!  Print system is based on commands!!!! (I’m calm… don’t worry 🙂 )
  • ‘VIRTUALDIM’, ‘THIS’ and ‘RESOURCE’
    samples are wrongly categorized too.

I’m really tired to continue 🙂

THE SOLUTION

  1. If you already knows how HMG works and the differences between Controls, Commands and Functions, you can simply ignore the current categorization.
  1. If you are new to HMG and are trying to learn about it, please IGNORE THE CURRENT CATEGORIZATION and move each sample sub-folder to the main SAMPLES one. Moreover, as you learn, you can create your own categories and put the samples belonging to each one in its correct place.

IMPORTANT NOTE (Déjà vu):

Many of you should be thinking: “Not a big problem… I’m able to find any sample as they are organized now…“.

Please, consider that I’m thinking (specially) on new users arriving to HMG and the difficulties that could frustrate them.  New users should have the best experience possible.

ANOTHER NOTE:

Some of the problems described here, were already posted to HMG developers and they will be fixed in the next versions (at the time of this writing version is 3.4.3).

THE END:

If you want to discuss about this (even to disagree with me🙂 ) you ca do it here (you need a SourceForge account to be able to post).

Posted in Uncategorized

TUNING HMG: Program Editor!

From its first release (mid 2005) my idea about HMG was that, it should be a ‘zero-configuration’, ‘ready-to-use’, ‘out-of-the-box’ development tool.

According to these goals, HMG was the first Harbour distribution including a C compiler being pre-configured to work immediately after install.

At that time, you only needed to do the following at command line:

compile <ypur_prg>

Seconds later, a stand-alone Windows exe file was ready for you (almost a “miracle” at that time) :).

The following design step (some years later) was to add a friendly face to HMG, it was the HMG-IDE utility.

It had to follow the same goals, then… you only must click on the ‘new Project’ button, pick a folder and set a name for the project, then a main program module, a main window and required project files are automatically created for you. The only thing to complete your first experience with IDE, is to click the ‘Run’ button… then… TA DA!!!

As an IDE companion, I’ve added to the HMG distribution a great programmers editor (Notepad++).

Notepad++ is free, open source, lightweight, very fast and plenty of great features for programmers.

For some reason that I’m not able to understand, one fine day, Notepad++ was retired from HMG distribution, so… now… when you double-click on a program module on IDE’s project browser, or in the event of some widget to create or edit a code snippet: NOTHING HAPPENS!… then… the ‘out-of-the-box’, ‘zero-configuration’ experience IS BROKEN!

Even when on future versions of IDE, it be pre-configured to use the Windows Notepad (a text editor well known to have nearly zero features) the user experience will be ‘sad’ (or some other adequate word that not comes to my mind right now) :).

So.. how to solve this:

  1. Download Notepad++ here
  2. Install at some place (no matters)
  3. On IDE, go to TOOLS-PREFERENCES
  4. Click on the ‘three dotted’ button on the ‘Module Editor’ section.
  5. Pick the Notepad++ executable from its installation folder.
  6. Click ok… ok… etc.

IMPORTANT NOTE (I):

Many of you should be thinking: “Not a big problem… I’m already have a favorite editor… I just must to configure IDE for it… “.

Please, consider that I’m thinking (specially) on new users arriving to HMG and the difficulties that could frustrate them.  New users should have the best experience possible.

IMPORTANT NOTE (II):

You can change the name (Notepad++) by any of the other great open source editors outhere, but a quality programmers editor should be added to HMG distribution and IDE  should be pre-configured for it.

THE END:

If you want to discuss about this (even to disagree with me 🙂 ) you ca do it here (you need a SourceForge account to be able to post).

Posted in Uncategorized

TUNING HMG: OptionBox()

Note: This function was already posted to HMG developers and it will be included in the next version (but it is not available on the current (at the time of this writing) 3.4.3)

Some years ago, I’ve created a tiny function for my own use.

This is called ‘OptionBox‘ and its name is self-explanatory :)

FUNCTION OPTIONBOX( cTitle , aOptions , nDefault )

PRIVATE nRet

   IF VALTYPE(nDefault) = 'U'
      nDefault := 1
   ENDIF

         DEFINE WINDOW OPTIONBOX ;
      AT 0,0 ;
      WIDTH 275 HEIGHT 170 + ( 30 * ( LEN(aOptions) - 2 ) );
      TITLE cTitle  ;
      MODAL NOSIZE NOSYSMENU

      DEFINE FRAME Frame_1
         ROW   04
         COL   10
         WIDTH   250
         HEIGHT   80 + ( 30 * ( LEN(aOptions) - 2 ) )
         CAPTION ''
      END FRAME

      DEFINE RADIOGROUP Radio_1
         ROW   20
         COL   30
         WIDTH   230 
         HEIGHT   100 + ( 30 * ( LEN(aOptions) - 2 ) )
         OPTIONS   aOptions
         VALUE   nDefault
         ONCHANGE {|| nRet := THIS.VALUE }
      END RADIOGROUP

      DEFINE BUTTON OK
         ROW   100 + ( 30 * ( LEN(aOptions) - 2 ) )
         COL   30
         CAPTION   'Aceptar'
         ACTION   OPTIONBOX_OK()
      END BUTTON

      DEFINE BUTTON CANCEL
         ROW   100 + ( 30 * ( LEN(aOptions) - 2 ) )
         COL   140
         CAPTION   'Cancelar'
         ACTION   OPTIONBOX_CANCEL()
      END BUTTON

   END WINDOW

   CENTER WINDOW OPTIONBOX
   ACTIVATE WINDOW OPTIONBOX


RETURN nRet

PROCEDURE OPTIONBOX_OK
   nRet := OPTIONBOX.RADIO_1.VALUE
   THISWINDOW.RELEASE
RETURN

PROCEDURE OPTIONBOX_CANCEL
   nRet := 0
   THISWINDOW.RELEASE
RETURN

Download the code (‘optionbox.7z’) from here

You can comment about this here (you need a SourceForge account to be able to post)

Enjoy!

Posted in Uncategorized

TUNING…

I: TUNING THIS BLOG

I’ve addressed two problems.

  1. File Download: Many people complained about downloading the demos, so I’ve changed that, so, from now, they can be downloaded from HMG Sourceforge Site (the links on post has been updated).
  1. The comments section:  This section, at the end of each post, does not allows a fluid communication between users, so, using the Sourceforge infrastructure,  I’ve created a discussion forum  to talk about the articles posted here (you must have a SourceForge account to be able to post).

II: TUNING HMG (THE OPEN SOURCE MIRACLE) 🙂

Open source is wonderful… all people knows… well… at least… most of us knows 🙂

One of the best things of open source is, that we can modify the sources to get exactly what we want.

Sometimes we add new features… sometimes we change existing ones…

SO… WHAT ARE YOU TALKING ABOUT?

On the last years, I’ve made little changes to HMG distributions, creating ‘tuned’ versions for my own use.

My initial thinking was, that nobody could be interested on those small changes, but… maybe I’m wrong…

This series of articles will be about ‘tuning’ HMG, I mean, making it better from my own very subjective point of view.

WAIT A MOMENT… WHY DO YOU NOT SIMPLY SUBMIT YOUR PROPOSED CHANGES TO HMG DEVELOPERS INSTEAD TO WRITE THIS THING?

Mainly because I don’t want to disturb the development team, proposing changes based on my personal point of view about what HMG should be.

SO… IT IS YOUR CHOICE

From now, I’ll publish on this blog, little portions of code to make small changes to HMG that I’ve considered, make it a little better.

It is your choice to evaluate them and decide to incorporate or not to your own HMG.

Posted in Uncategorized