Page 4 of 6

Re: HMG 3.0.25

Posted: Wed Mar 17, 2010 1:33 am
by Roberto Lopez
Steed wrote:Hello Roberto,

Will be nice and more naturally, modify cell in a grid without press enter, like Excel or access (you only press any key -char or val- and the cell pass to edit mode adding the char or value that you have pressed)

Nice idea Sudip

Regards

Ed
I'll think about that...

Re: HMG 3.0.25

Posted: Thu Mar 18, 2010 3:52 am
by sudip
Hello,

We can't modify SQLMIX RDD tables with grid right now. Good news is that we can modify temporary tables created with HB_DBCREATETEMP() function with grid :)

But, I am not sure if there any problem with using this temporary tables :?

So, it will be very helpful regarding your views about using this temporary tables :)

Thanks in advance.

With best regards.

Sudip

Re: HMG 3.0.25

Posted: Thu Mar 18, 2010 5:17 am
by sudip
Hello Roberto,

I found some problem using grid and refreshing it after appending records in tables. I am creating a small sample from my project to demonstrate this. When "Calculate" button is clicked, grid shows an extra record. :o (may be there is a bug in my code :( )

Code: Select all

#include <minigui.ch>

static aMonth := {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}

Function main()
   local adbf := {}
   
   if select("tempsalreg") > 0
      select tempsalreg
      use
   endif
   
   aadd(adbf,  {"Empnm",      "C",  40,   0})
   aadd(adbf,  {"Workdays",   "N",  2,    0})
   aadd(adbf,  {"Basic",      "N",  10,   2})
   aadd(adbf,  {"DA",         "N",  10,   2})
   aadd(adbf,  {"FA",         "N",  10,   2})
   //DBCREATE("tempsalreg", adbf, "SQLMIX", .T., "TEMPSALREG")
   hb_dbcreatetemp("tempsalreg", adbf)
   

   DEFINE WINDOW frmSalreg ;
      WIDTH 700             ;
      HEIGHT 550             ;
      TITLE "Salary Register" ;
      main
      
      
      DEFINE LABEL lblYear
         ROW    10
         COL    20
         WIDTH  31
         HEIGHT 20
         VALUE "Year:"
      END LABEL  
      
      DEFINE SPINNER spnYear
         ROW    10
         COL    60
         WIDTH  70
         HEIGHT 24
         RANGEMIN 1
         RANGEMAX 2050
      END SPINNER  
      
      DEFINE LABEL lblMonth
         ROW    10
         COL    220
         WIDTH  45
         HEIGHT 21
         VALUE "Month:"
      END LABEL  
      
      DEFINE COMBOBOX cboMonth
         ROW    10
         COL    270
         WIDTH  100
         HEIGHT 100
         ITEMS aMonth
      END COMBOBOX  
      
      DEFINE BUTTON cmdCalc
         ROW    10
         COL    470
         WIDTH  100
         HEIGHT 28
         ACTION SalRegCalc()
         CAPTION "&Calculate"
      END BUTTON
      
      DEFINE GRID GRID_1
         ROW 50
         COL 20
         WIDTH 610
         HEIGHT 380
         HEADERS {"Employee", "Wk Days", "Basic", "DA", "FA"}
         WIDTHS {200, 100, 100, 100, 100}
         ROWSOURCE "TEMPSALREG"
         COLUMNFIELDS {"EMPNM", "WORKDAYS", "BASIC", "DA", "FA"}
         JUSTIFY {0, 1, 1, 1, 1}
         COLUMNCONTROLS {{"TEXTBOX", "CHARACTER"}, {"TEXTBOX", "NUMERIC", "999"}, {"TEXTBOX", "NUMERIC", "99999999.99"}, {"TEXTBOX", "NUMERIC", "99999999.99"}, {"TEXTBOX", "NUMERIC", "99999999.99"}}
         ALLOWEDIT .T.
      END GRID         

      
   END WINDOW


	
	frmSalreg.spnYear.value := year(date())
	frmSalreg.cboMonth.value := month(date())
	frmSalreg.Center
	frmSalreg.Activate
	
	
	if select("tempsalreg") > 0
	  select tempsalreg
	  use
	endif
Return Nil


static function SalRegCalc()
   local table := {}, i
   SELECT TEMPSALREG
   zap
   for i := 1 to 10
      aadd(table, {"Employee "+ltrim(str(i))})
   next
   //table := sql(mdb, "select empnm from emp order by slno")
   for i = 1 to len(table)
      append blank
      replace empnm with table[i, 1]
   next
   FRMSALREG.GRID_1.REFRESH
return nil
Thanks in advance. :)

With best regards.

Sudip

Re: HMG 3.0.25

Posted: Sat Mar 20, 2010 7:39 pm
by Roberto Lopez
Vanguarda wrote:Dear Roberto,

How do you like these clips were made?

example: In a OBJETIVE "textbox" want it presented a window like the one below, or not?

Sorry my bad english.

My best regards,
I've only read about this feature on PsPad, but I don't know how to do it.

Re: HMG 3.0.25

Posted: Sat Mar 20, 2010 7:49 pm
by Roberto Lopez
sudip wrote:Hello Roberto,

I found some problem using grid and refreshing it after appending records in tables. I am creating a small sample from my project to demonstrate this. When "Calculate" button is clicked, grid shows an extra record. :o (may be there is a bug in my code :( )

Code: Select all

#include <minigui.ch>

static aMonth := {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}

Function main()
   local adbf := {}
   
   if select("tempsalreg") > 0
      select tempsalreg
      use
   endif
   
   aadd(adbf,  {"Empnm",      "C",  40,   0})
   aadd(adbf,  {"Workdays",   "N",  2,    0})
   aadd(adbf,  {"Basic",      "N",  10,   2})
   aadd(adbf,  {"DA",         "N",  10,   2})
   aadd(adbf,  {"FA",         "N",  10,   2})
   //DBCREATE("tempsalreg", adbf, "SQLMIX", .T., "TEMPSALREG")
   hb_dbcreatetemp("tempsalreg", adbf)
   

   DEFINE WINDOW frmSalreg ;
      WIDTH 700             ;
      HEIGHT 550             ;
      TITLE "Salary Register" ;
      main
      
      
      DEFINE LABEL lblYear
         ROW    10
         COL    20
         WIDTH  31
         HEIGHT 20
         VALUE "Year:"
      END LABEL  
      
      DEFINE SPINNER spnYear
         ROW    10
         COL    60
         WIDTH  70
         HEIGHT 24
         RANGEMIN 1
         RANGEMAX 2050
      END SPINNER  
      
      DEFINE LABEL lblMonth
         ROW    10
         COL    220
         WIDTH  45
         HEIGHT 21
         VALUE "Month:"
      END LABEL  
      
      DEFINE COMBOBOX cboMonth
         ROW    10
         COL    270
         WIDTH  100
         HEIGHT 100
         ITEMS aMonth
      END COMBOBOX  
      
      DEFINE BUTTON cmdCalc
         ROW    10
         COL    470
         WIDTH  100
         HEIGHT 28
         ACTION SalRegCalc()
         CAPTION "&Calculate"
      END BUTTON
      
      DEFINE GRID GRID_1
         ROW 50
         COL 20
         WIDTH 610
         HEIGHT 380
         HEADERS {"Employee", "Wk Days", "Basic", "DA", "FA"}
         WIDTHS {200, 100, 100, 100, 100}
         ROWSOURCE "TEMPSALREG"
         COLUMNFIELDS {"EMPNM", "WORKDAYS", "BASIC", "DA", "FA"}
         JUSTIFY {0, 1, 1, 1, 1}
         COLUMNCONTROLS {{"TEXTBOX", "CHARACTER"}, {"TEXTBOX", "NUMERIC", "999"}, {"TEXTBOX", "NUMERIC", "99999999.99"}, {"TEXTBOX", "NUMERIC", "99999999.99"}, {"TEXTBOX", "NUMERIC", "99999999.99"}}
         ALLOWEDIT .T.
      END GRID         

      
   END WINDOW


	
	frmSalreg.spnYear.value := year(date())
	frmSalreg.cboMonth.value := month(date())
	frmSalreg.Center
	frmSalreg.Activate
	
	
	if select("tempsalreg") > 0
	  select tempsalreg
	  use
	endif
Return Nil


static function SalRegCalc()
   local table := {}, i
   SELECT TEMPSALREG
   zap
   for i := 1 to 10
      aadd(table, {"Employee "+ltrim(str(i))})
   next
   //table := sql(mdb, "select empnm from emp order by slno")
   for i = 1 to len(table)
      append blank
      replace empnm with table[i, 1]
   next
   FRMSALREG.GRID_1.REFRESH
return nil
Thanks in advance. :)

With best regards.

Sudip
I'll check it ASAP.

Re: HMG 3.0.25

Posted: Sat Mar 20, 2010 9:34 pm
by Vanguarda
Roberto Lopez wrote: I've only read about this feature on PsPad, but I don't know how to do it.
Hi dear Roberto,

I´ve working on clip for HMG on PsPad.
I still thinking about the best way for to do it.

I hope that when finished, it can be useful for all us.
I will finish it ASAP.

My best regards,

Re: HMG 3.0.25

Posted: Sun Mar 21, 2010 1:04 pm
by Roberto Lopez
Vanguarda wrote:
Roberto Lopez wrote: I've only read about this feature on PsPad, but I don't know how to do it.
Hi dear Roberto,

I´ve working on clip for HMG on PsPad.
I still thinking about the best way for to do it.

I hope that when finished, it can be useful for all us.
I will finish it ASAP.

My best regards,
Thanks!

Re: HMG 3.0.25

Posted: Sun Mar 21, 2010 1:11 pm
by Roberto Lopez
sudip wrote:Hello,

We can't modify SQLMIX RDD tables with grid right now.
I've added the 'OnSave' method to let the users create its own save procedures when working (ie) with SQL RDDs, so, you could do it now for SQLMIX.

Re: HMG 3.0.25

Posted: Sun Mar 21, 2010 1:13 pm
by Roberto Lopez
sudip wrote:Hello Roberto,

I found some problem using grid and refreshing it after appending records in tables. I am creating a small sample from my project to demonstrate this. When "Calculate" button is clicked, grid shows an extra record. :o (may be there is a bug in my code :( )
I confirm the bug.

The problem arises only when you add records without using the grid internal procedure for that.

I'm working on it.

Thanks for reporting.

Re: HMG 3.0.25

Posted: Mon Mar 22, 2010 1:10 am
by Roberto Lopez
Roberto Lopez wrote: I confirm the bug.

The problem arises only when you add records without using the grid internal procedure for that.
I've 'reduced' the problem.

It arises only when the table is empty at the moment of the grid creation.

In all other situations, adding records outside the grid appears to work fine.

I'm still working on it.