hmg-4 Changelog

Moderator: Rathinagiri

mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: hmg-4 Changelog

Post by mrduck »

Code: Select all

2011-10-22 23:17 UTC+0100 Francesco Perillo ( fperillo at gmail.com )
   * source/combobox.prg
     * fixed typo - onChange was not working...
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: hmg-4 Changelog

Post by l3whmg »

Hi friends,
I have introduced a "busy indicator" or "work in progress" window. It's like WAIT .... in HMG3.
I don't know if it's a good code, I hope someone can improve it or have other idea.

This can be useful when you have a long procedure to show "program is alive, not dead!". You can refer to samples/waitwin folder to see usage with OOP and XBase commands. This window show: a label message and a progress bar with infinite loop.

With Xbase the command is like previous HMG3; I have only added "TITLE" and "ICON" to show a title and icon on the window.
Syntax is: WAIT WINDOW [<cTextMessage>] [<lNoWait: NOWAIT> ] [TITLE <cTitle>] [ICON <cIcon>]
At the same time I fixed about command "DO EVENTS" to prevent gui freezing. With OOP style is HMGAPP():ProcessEvents()
With this version user can "cancel" the operation, for this reason I add this translation value WAITISCANC - about XBase command - to know if user press the "cancel" button and with OOP style is object:Canceled(); it returns .T. or .F.

IMPORTANT: at this time, there is a problem with/without NOWAIT option, because I was not able to implement waiting for a keypress. So with NOWAIT or without NOWAIT option the usage is the same: it's not required to press a button to start.

Simple example

Code: Select all

   WITH OBJECT oWaitWin := WAITWIN():New()
      :Caption    := "Wait message: please wait 10 secs. or press 'Cancel'"  // by default is "Work in progress . . . ."
      :NoWait     := .T.              // by default is .F.
      :Title      := "window title"       // new parameter
      :Icon       := "hmg.ico"            // new parameter
   END WITH

   oWaitWin:Activate()

   nSecondsToWait := 10
   WHILE nSecondsToWait > 0

      HMGAPP():ProcessEvents()      // to prevent freezing

      IF oWaitWin:Canceled() == .T.
         MsgStop( "User press 'Cancel'" )
         EXIT
      ELSE
         INKEY( 1 )
         nSecondsToWait -= 1
      ENDIF

   END

   oWaitWin:Release()

Code: Select all

2011-10-23 18:20 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> )
   + samples/waitwin
   + samples/waitwin/build.bat
   + samples/waitwin/demo_1.prg
   + samples/waitwin/demo_2.prg
   + samples/waitwin/hmg.ico
   + samples/waitwin/qt.conf

   * include/hmg.ch
     + "xcommand DO EVENTS" command to force Qt event processing.
       It calls HMGAPP():ProcessEvents() method
     ! "xcommand WAIT WINDOW" to create/start WAITWIN object. It calls worker
       function HmgWaitWinInit( cText, lNoWait )
     ! "xcommand WAIT CLEAR" to close WAITWIN object. It calls worker
       function HmgWaitWinRelease()
     + "xtranslate WAITISCANC" to know if user press cancel. It calls worker
       function HmgWaitWinCanceled()
     ! "RELEASE WINDOW ALL" now ends MainWindow

   * source/misc.prg
     + HmgWaitWinInit( cText, lNoWait ) public function
     + HmgWaitWinRelease() public function
     + HmgWaitWinCanceled() public function

   * hmg.hbp
     + waitwin.prg

   + source/waitwin.prg
     * to show wait/busy message with a progress bar; can be used during
       long operation.

   * source/hmgapp.prg
     + ProcessEvents() method. It forces Qt event processing
Luigi from Italy
www.L3W.it
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: hmg-4 Changelog

Post by l3whmg »

Hi to everyone

Code: Select all

2011-10-24 14:25 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> )
   ! samples/window.modal/demo_1.prg
   ! samples/window.modal/demo_2.prg
   ! samples/window.modal/demo_3.prg
   ! samples/window.close/demo_1.prg
   ! samples/widget/demo_3a.prg
   ! samples/virtualgrid/browse_demo_5.prg
   ! samples/virtualgrid/browse_demo_3.prg
   ! samples/layout/demo_5.prg
   ! samples/timer/demo_2.prg
     ! code about new *window classes
Luigi from Italy
www.L3W.it
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: hmg-4 Changelog

Post by l3whmg »

Hi friends.
Thanks to Ricci to suggest me something ;)

Code: Select all

2011-10-25 11:40 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> )
   * samples/toolbar/demo_1.prg
   * samples/toolbar/demo_5.prg
     * OOP and XBase commands syntax to show usage new parameters

   ! include/hmg.ch
     ! "DEFINE TOOLBAR" commands wrong coding and:
       + option "ALLOWEDAREAS <nAllowedAreas>" to set allowed areas; see
         AllowedAreas() object method.
       + option "MOVEABLE     <lMoveable>" to set toolbar moveable; see
         Moveable() object method.
       + option "TBARPLACE    <nBarPlace>" where toolbar must be placed; see
         TbarPlace() object method.
     + "xcommand ALLOWEDAREAS <value>" to set allowed areas; see
         AllowedAreas() object method.
     + "xcommand MOVEABLE     <value>" to set toolbar moveable; see
         Moveable() object method.
     + "xcommand TBARPLACE    <value>" where toolbar must be placed; see
         TbarPlace() object method.

   ! source/toolbar.prg
     + Moveable() method (SETGET option) to know/set if toolbar has fixed
       position. By default toolbars are moveable (.T.) else (.F.) are fixed.
     + AllowedAreas() method (SETGET option) to know/set allowed areas to move
       a toolbar.  Right values are: Qt_LeftToolBarArea, Qt_RightToolBarArea,
       Qt_TopToolBarArea, Qt_BottomToolBarArea and Qt_AllToolBarAreas.
     + TbarPlace() method (SETGET option only to set) to place toolbar in an
       allowed area. Right values are: Qt_LeftToolBarArea, Qt_RightToolBarArea,
       Qt_TopToolBarArea, Qt_BottomToolBarArea
Luigi from Italy
www.L3W.it
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: hmg-4 Changelog

Post by mrduck »

Code: Select all

2011-10-26 00:17 UTC+0100 Francesco Perillo ( fperillo at gmail.com )
   * source/grid.prg
     * fixed problem with header selected when only one row present (by Ricci)
     * icon as a cell content (by Ricci). I think we can also have text in the
       cell and code should be expanded a bit
     * use NIL as header icon if a header should not have icons
   * samples/grid/demo_3.prg
     * sample adapted to demo these features

Code for setting the header icon is present 3 times in grid.prg, in the following 3 methods:
ColumnHeaders( aValue )
Header( nCol, cValue )
HeaderImages( aValue )

... so I propose to add a fouth method and move the real, low-level code to this fourth. In the other 3 methods remove the actual code and call the new method....


In grid:create we should check that all the possible configuration arrays have the same lenght, like in HMG3. So a error message can be disaplyed and not a runtime, out of bound array access, error...
User avatar
danielmaximiliano
Posts: 2647
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: hmg-4 Changelog

Post by danielmaximiliano »

Hi
I have an error and I can not compile the libraries HMG.4
commented that HMG.4 install Binaries + Source Release (2011.10.20) on my drive E:

update with TortoiseSVN
BuildLib.bat I get the following error: Attached Image
buildlib.png
buildlib.png (34.09 KiB) Viewed 3381 times
thanks for your help.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: hmg-4 Changelog

Post by mrduck »

danielmaximiliano wrote: I have an error and I can not compile the libraries HMG.4

Code: Select all

2011-10-26 09:50 UTC+0100 Francesco Perillo ( fperillo at gmail.com )
   * source/grid.prg
     * missing variable declaration
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: hmg-4 Changelog

Post by mrduck »

Code: Select all

2011-10-26 10:58 UTC+0100 Francesco Perillo ( fperillo at gmail.com )
   * source/grid.prg
     * added method headerImage(nCol,cIconFileName)
   * samples/grid/demo_3.prg
     * sample adapted to demo the feature (click on column 1 header)

Now it is possible to add/remove header icon at runtime. See demo_3 and click on header of column 1
Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Re: hmg-4 Changelog

Post by Ricci »

Now I only have to find out how to center an icon in a cell.
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: hmg-4 Changelog

Post by mrduck »

Ricci wrote:Now I only have to find out how to center an icon in a cell.
Are you going c++ ??? :-)

It's not possible to do at Qt level, but only at c++
see
http://stackoverflow.com/questions/1707 ... er-of-cell

Probably you may trap paint event and draw it yourself. there are some samples in c++ but it MAY work in harbour too... never tried....
Post Reply