HMG 3.0.25

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

Moderator: Rathinagiri

User avatar
Roberto Lopez
HMG Founder
Posts: 3986
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 27 times
Been thanked: 168 times

Re: HMG 3.0.25

Post 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...
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
sudip
Posts: 1446
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India
Has thanked: 5 times
Been thanked: 2 times

Post 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
With best regards,
Sudip

User avatar
sudip
Posts: 1446
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India
Has thanked: 5 times
Been thanked: 2 times

Post 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
With best regards,
Sudip

User avatar
Roberto Lopez
HMG Founder
Posts: 3986
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 27 times
Been thanked: 168 times

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3986
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 27 times
Been thanked: 168 times

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Vanguarda
Posts: 543
Joined: Wed Feb 11, 2009 10:56 am
Location: Americana - SP
Been thanked: 1 time
Contact:

Post 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,
--
Paulo Sérgio Durço (Vanguarda)


http://hmglights.wordpress.com/

User avatar
Roberto Lopez
HMG Founder
Posts: 3986
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 27 times
Been thanked: 168 times

Post 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!
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3986
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 27 times
Been thanked: 168 times

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3986
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 27 times
Been thanked: 168 times

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3986
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 27 times
Been thanked: 168 times

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

Post Reply