Harbour MiniGUI 2.8.2

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

Moderator: Rathinagiri

User avatar
Roberto Lopez
HMG Founder
Posts: 3919
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 15 times
Been thanked: 140 times

Re: Harbour MiniGUI 2.8.2

Post by Roberto Lopez » Mon Apr 13, 2009 12:47 pm

Roberto Lopez wrote: When the code had be proven to be stable and be working for Browse too, I've planned to add a new property (something like 'SelectedCol') but I've not decided yet.
And (more important) since an official release has been published with 'value' property returning the selected row value for 'by cell navigation' grid, it will NO CHANGE in future versions to preserve backwards compatibility.

So, as I've said you can expect a new property for selected column value.

Regards,

Roberto.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
esgici
Posts: 4472
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 352 times
Been thanked: 104 times
Contact:

Post by esgici » Mon Apr 13, 2009 12:59 pm

Roberto Lopez wrote:I've planned to add a new property (something like 'SelectedCol')
This is a very good news :)
... working for Browse too ...
And this is the better one :D

Thanks a lot Roberto

--

Esgici
Viva INTERNATIONAL HMG :D

User avatar
Roberto Lopez
HMG Founder
Posts: 3919
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 15 times
Been thanked: 140 times

Post by Roberto Lopez » Mon Apr 13, 2009 1:04 pm

esgici wrote:
Roberto Lopez wrote:I've planned to add a new property (something like 'SelectedCol')
This is a very good news :)
... working for Browse too ...
And this is the better one :D

Thanks a lot Roberto

--

Esgici
Well.. since appears to be a lot of interest about this... until the new property be ready, you can retrieve the selected column this way:

Code: Select all

cWindow := 'Your Window Name'
cControl := 'Your Grid Name'

nSelectedCol := _HMG_SYSDATA [15] [ GetControlIndex ( cControl , cWindow ) ]

Since the selected column number will stay in #15 slot, it will work in all future versions.

Regards,

Roberto.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Rathinagiri
Posts: 5250
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 167 times
Been thanked: 165 times
Contact:

Post by Rathinagiri » Mon Apr 13, 2009 1:15 pm

Oh! Nice. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
esgici
Posts: 4472
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 352 times
Been thanked: 104 times
Contact:

Post by esgici » Mon Apr 13, 2009 1:18 pm

Very well, this is already achieved :D

Code: Select all

FUNCTION GetGridColumnNumber( cWindowName, cGridName )
RETURN ( _HMG_SYSDATA [15] [ GetControlIndex ( cGridName , cWindowName ) ] )
Best Regards

--

Esgici
Viva INTERNATIONAL HMG :D

User avatar
Roberto Lopez
HMG Founder
Posts: 3919
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 15 times
Been thanked: 140 times

Post by Roberto Lopez » Mon Apr 13, 2009 1:30 pm

rathinagiri wrote:Oh! Nice. :)
Anyway... you made me think more deeper about value for 'by cell' grids.

I'm thinking about consistency.

Perhaps you are right.

'Value' property for grids return selected row number for standard grids, but it returns an array for multiselect (multiple selection rows) grids.

So, a consistent, more logical behavior could be (as you suggested) return an array containing row and col of the current selection, that is a cell, not a row.

Any thoughts and suggestions are welcome.

If I've committed a mistake, I can fix it.

Regards,

Roberto.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
esgici
Posts: 4472
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 352 times
Been thanked: 104 times
Contact:

Post by esgici » Mon Apr 13, 2009 1:37 pm

Roberto Lopez wrote: So, a consistent, more logical behavior could be return an array containing row and col of the current selection, that is a cell, not a row.
Any thoughts and suggestions are welcome.
My vote is yes; this is the better.

Best Regards

--

Esgici
Viva INTERNATIONAL HMG :D

User avatar
Rathinagiri
Posts: 5250
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 167 times
Been thanked: 165 times
Contact:

Post by Rathinagiri » Mon Apr 13, 2009 1:40 pm

Thanks for consideration Roberto. Also, if it is two way traffic (ie., not only getting the value and setting it) my happiness would be doubled.

For example,

Code: Select all

   form1.grid1.item(x,y) := "Item value at x,y"
   aValue := form1.grid1.value 
   form1.grid1.value := {x,y}
   cItem := form1.grid1.item(x,y)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
gfilatov
Posts: 582
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 17 times
Been thanked: 148 times
Contact:

Post by gfilatov » Mon Apr 13, 2009 2:22 pm

rathinagiri wrote:Thanks for consideration Roberto. Also, if it is two way traffic (ie., not only getting the value and setting it) my happiness would be doubled.
Hi Rathi,

We have a Cell read/write property for that. :idea:
Form_1.Grid_1.Cell(1,1) := 'New'
MsgInfo ( Form_1.Grid_1.Cell(1,1) )

Take a look for sample below:

Code: Select all

/*
 * MINIGUI - Harbour Win32 GUI library Demo
 *
 * Copyright 2008 Roberto Lopez <harbourminigui@gmail.com>
 * http://harbourminigui.googlepages.com/
*/

#include "minigui.ch"

Function Main
Local aRows [20] [3]

	aRows [1]	:= {'Simpson','Homer','555-5555'}
	aRows [2]	:= {'Mulder','Fox','324-6432'} 
	aRows [3]	:= {'Smart','Max','432-5892'} 
	aRows [4]	:= {'Grillo','Pepe','894-2332'} 
	aRows [5]	:= {'Kirk','James','346-9873'} 

	DEFINE WINDOW Form_1 ;
		AT 0,0 ;
		WIDTH 640 HEIGHT 480 ;
		TITLE 'Harbour MiniGUI Demo' ;
		MAIN 

		DEFINE MAIN MENU
			DEFINE POPUP 'Test'
				MENUITEM 'Get Button Caption' ACTION MsgInfo ( Form_1.Tab_1(1).Button_1.Caption ) 
				MENUITEM 'Set Button Caption' ACTION Form_1.Tab_1(1).Button_1.Caption := 'New'
				SEPARATOR
				MENUITEM 'Get Grid Header' ACTION MsgInfo ( Form_1.Tab_1(4).Grid_1.Header(1) ) 
				MENUITEM 'Set Grid Header' ACTION Form_1.Tab_1(4).Grid_1.Header(1) := 'New'
				SEPARATOR
				MENUITEM 'Set Grid Cell' ACTION Form_1.Tab_1(4).Grid_1.Cell(1,1) := 'New'
				MENUITEM 'Get Grid Cell' ACTION MsgInfo ( Form_1.Tab_1(4).Grid_1.Cell(1,1) )
				SEPARATOR
				MENUITEM 'Show Button' ACTION Form_1.Tab_1(1).Button_1.Show()
				MENUITEM 'Hide Button' ACTION Form_1.Tab_1(1).Button_1.Hide()
			END POPUP
		END MENU

		DEFINE TAB Tab_1 ;
			AT 10,10 ;
			WIDTH 600 ;
			HEIGHT 400 ;
			VALUE 1 ;
			TOOLTIP 'Tab Control' 

			PAGE 'Page 1' 

			      @ 100,250 BUTTON Button_1 CAPTION "Test" WIDTH 50 HEIGHT 50 ACTION MsgInfo('Test!')

			END PAGE

			PAGE 'Page &2' 

				DEFINE RADIOGROUP R1
					ROW	100
					COL	100
					OPTIONS	{ '1','2','3' }
					VALUE	1
				END RADIOGROUP

			END PAGE

			PAGE 'Page 3' 

				@ 100,250 SPINNER Spinner_1 ;
				RANGE 0,10 ;
				VALUE 5 ;
				WIDTH 100 ;
				TOOLTIP 'Range 0,10' ; 
				ON CHANGE PlayBeep() 

			END PAGE

			PAGE 'Page 4' 

				@ 50,50 GRID Grid_1 ;
					WIDTH 200 ;
					HEIGHT 330 ;
					HEADERS {'Last Name','First Name','Phone'} ;
					WIDTHS {140,140,140};
					ITEMS aRows ;
					VALUE 1 

			END PAGE

		END TAB

	END WINDOW

	Form_1.Center

	Form_1.Activate

Return Nil
Last edited by gfilatov on Mon Apr 13, 2009 2:44 pm, edited 1 time in total.
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein

User avatar
esgici
Posts: 4472
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 352 times
Been thanked: 104 times
Contact:

Post by esgici » Mon Apr 13, 2009 2:37 pm

gfilatov wrote: We have a Cell read/write property for that. :idea:
Hi Grigory

Sorry, where is selected :?:

Regards

--

Esgici
Viva INTERNATIONAL HMG :D

Post Reply