Page 2 of 4

Re: Harbour MiniGUI 2.8.2

Posted: Mon Apr 13, 2009 12:47 pm
by Roberto Lopez
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.

Re: Harbour MiniGUI 2.8.2

Posted: Mon Apr 13, 2009 12:59 pm
by esgici
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

Re: Harbour MiniGUI 2.8.2

Posted: Mon Apr 13, 2009 1:04 pm
by Roberto Lopez
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.

Re: Harbour MiniGUI 2.8.2

Posted: Mon Apr 13, 2009 1:15 pm
by Rathinagiri
Oh! Nice. :)

Re: Harbour MiniGUI 2.8.2

Posted: Mon Apr 13, 2009 1:18 pm
by esgici
Very well, this is already achieved :D

Code: Select all

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

--

Esgici

Re: Harbour MiniGUI 2.8.2

Posted: Mon Apr 13, 2009 1:30 pm
by Roberto Lopez
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.

Re: Harbour MiniGUI 2.8.2

Posted: Mon Apr 13, 2009 1:37 pm
by esgici
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

Re: Harbour MiniGUI 2.8.2

Posted: Mon Apr 13, 2009 1:40 pm
by Rathinagiri
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)

Re: Harbour MiniGUI 2.8.2

Posted: Mon Apr 13, 2009 2:22 pm
by gfilatov
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

Re: Harbour MiniGUI 2.8.2

Posted: Mon Apr 13, 2009 2:37 pm
by esgici
gfilatov wrote: We have a Cell read/write property for that. :idea:
Hi Grigory

Sorry, where is selected :?:

Regards

--

Esgici