With a little help from the forum...

HMG announcements; Latest HMG-related news, releases, fixes and updates.

Moderator: Rathinagiri

User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

With a little help from the forum...

Post by Roberto Lopez »

Hi All,

Marek found a problem in 3.0.29 test release, probably related to the new panel type windows, creating a run-time error.
Error: HMG 3.0.29 (2010.04.11)
Non top modal windows can't be released. Program terminated
Please, test it and if you found the problem, try to create a small sample, so I'll be able to solve.

TIA.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Rathinagiri
Posts: 5481
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: With a little help from the forum...

Post by Rathinagiri »

Ok Roberto.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: With a little help from the forum...

Post by esgici »

Sorry, its very difficult to reach same error :(

Only Marek can give some hints :(

While searching I encounter another things :

Code: Select all

#include <minigui.ch>

PROC Main()

*  DECLARE frmSecond, frmThird 
  
  DEFINE WINDOW frmMFMain ;
	 AT 138, 235 ; 
	 WIDTH   550 ;
	 HEIGHT  350 ;
	 TITLE "Main Form" ;
	 MAIN 
		 
	 DEFINE BUTTON Button_1
		ROW    40
		COL    50
		WIDTH  150
		HEIGHT 30
		ACTION Make2ndForm()
		CAPTION "Second Form"
	 END BUTTON
/*
	 DEFINE BUTTON Button_2
		ROW    60
		COL    50
		WIDTH  150
		HEIGHT 30
		ACTION frmSecond.Release
		CAPTION "Release Second Form"
	 END BUTTON
	 	 
	 DEFINE BUTTON Button_3
		ROW    80
		COL    50
		WIDTH  150
		HEIGHT 30
		ACTION frmThird.Release
		CAPTION "Release Third Form"
	 END BUTTON
*/	 	 
  END WINDOW // frmMFMain 
  
  frmMFMain.Activate
  
Return // Main()


Procedure Make2ndForm()

  DEFINE WINDOW frmSecond OF frmMFMain;
	 AT      50, 50  ; 
	 WIDTH   250 ;
	 HEIGHT  150 ;
	 TITLE "Second Form (CHILD)" ;
	 CHILD

	 DEFINE BUTTON Button_1
		ROW    40
		COL    50
		WIDTH  150
		HEIGHT 30
		ACTION Make3thForm() 
		CAPTION "Make 3th Form"
	 END BUTTON

	 DEFINE BUTTON Button_2
		ROW    80
		COL    50
		WIDTH  150
		HEIGHT 30
		ACTION  this.Release 
		CAPTION "Release this (2nd) window"
		AUTOSIZE .T.
	 END BUTTON
	 	 
		 
  END WINDOW // frmSecond 
  
  frmSecond.Activate
	 
Return // Make2ndForm()


PROC Make3thForm()

  DEFINE WINDOW frmThird  OF frmMFMain;
	 AT      150, 150  ; 
	 WIDTH   250 ;
	 HEIGHT  150 ;
	 TITLE "Third Form (CHILD)" ;
	 CHILD
	 
	 DEFINE BUTTON Button_1
		ROW    40
		COL    50
		WIDTH  150
		HEIGHT 30
		ACTION This.Release
		CAPTION "Release THIS (3rd) Form"
	 END BUTTON
	 	 
		 
  END WINDOW // frmThird 
  
  frmThird.Activate
	 
RETU // Make3thForm()
- CHILD windows appears same as PANEL
- When attempting re-define a form after released, an error occurs

I don't know if this two points are important and related to the problem.

Best regards

--

Esgici
Viva INTERNATIONAL HMG :D
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: With a little help from the forum...

Post by Roberto Lopez »

esgici wrote:Sorry, its very difficult to reach same error :(

Only Marek can give some hints :(

While searching I encounter another things :
<...>

- CHILD windows appears same as PANEL
- When attempting re-define a form after released, an error occurs

I don't know if this two points are important and related to the problem.
Well... Panel windows are (almost) child widows with a parent.

So, giving to a child window a parent is (almost) a 'synonymous' for panel.

I've added the panel type, since IMHO, it could be confusing to have two classes of child windows (with and without parent).

So (if I've understood you correctly) this is not really a problem.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: With a little help from the forum...

Post by Roberto Lopez »

Roberto Lopez wrote:
Well... Panel windows are (almost) child widows with a parent.

So, giving to a child window a parent is a 'synonymous' for panel.

I've added the panel type, since IMHO, it could be confusing to have two classes of child windows (with and without parent).

So (if I've understood you correctly) this is not really a problem.

The bottom line is...

Don't attempt to use child windows in a different way that is documented.

That will led you to problems.

In general, using any thing in an non-documented way is not recommended and usually a source of problems.

I'll enforce error checking to avoid it anyway.

ie: In the same way that panel windows must not be activated it should be not released, since that should be done automatically via its parent.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: With a little help from the forum...

Post by sudip »

Hello Roberto,

I am facing a different type of problem. I found buttons having icons "MINIGUI_...", are not showing the icons. In the given sample please check Add, Modify and Delete buttons. But, these are working properly with 3.0.27.

Code: Select all

#include <hmg.ch>

Function Main

   DEFINE WINDOW main            ;
      AT 0,0               ;
      WIDTH 635            ;
      HEIGHT 460            ;
      TITLE 'Item Group Setup'   ;
      main

      DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 50,30 FLAT RIGHTTEXT BORDER

      BUTTON btnFirst       ;
         CAPTION '&Top' ;
         picture "HP_TOP" ;
         autosize

      BUTTON btnPrev    ;
         CAPTION '&Prev'    ;
         PICTURE "HP_BACK" ;
         autosize

      BUTTON btnNext   ;
         CAPTION '&Next'    ;
         PICTURE "HP_NEXT" ;
         autosize

      BUTTON btnLast       ;
         CAPTION '&Last'    ;
         PICTURE "HP_END" ;
         autosize

      BUTTON btnAdd       ;
         CAPTION '&Add'    ;
         PICTURE "MINIGUI_EDIT_NEW" ;
         autosize

      BUTTON btnModify       ;
         CAPTION '&Modify'    ;
         PICTURE "MINIGUI_EDIT_EDIT" ;
         autosize

      BUTTON btnDelete    ;
         CAPTION '&Delete'   ;
         PICTURE "MINIGUI_EDIT_DELETE" ;
         autosize

      END TOOLBAR
end window
main.center
main.activate
return nil
With best regards.

Sudip
With best regards,
Sudip
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: With a little help from the forum...

Post by Roberto Lopez »

sudip wrote:Hello Roberto,

I am facing a different type of problem. I found buttons having icons "MINIGUI_...", are not showing the icons. In the given sample please check Add, Modify and Delete buttons. But, these are working properly with 3.0.27.
<...>
I've changed all 'MINIGUI' names with 'HMG' from .0.29 release.

I've not documented that change, since these resources are attempted for internal use only.

So, please, rename the references in your sources, according the new names.

You can find it at \hmg\resources\hmg.rc.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: With a little help from the forum...

Post by esgici »

Roberto Lopez wrote: ... this is not really a problem.
OK, thanks for clarification.

Best regards

--

Esgici
Viva INTERNATIONAL HMG :D
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: With a little help from the forum...

Post by Roberto Lopez »

esgici wrote:
Roberto Lopez wrote: ... this is not really a problem.
OK, thanks for clarification.

Best regards

--

Esgici
I've already added code to prevent that a parent be implicit or explicit defined for a non-panel window, avoiding problems and confusion.

I've prevented explicit activation and release already.

This modifications will be available from 030 release.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: With a little help from the forum...

Post by esgici »

Thanks a lot Roberto :)

Best regards

--

Esgici
Viva INTERNATIONAL HMG :D
Post Reply