Calendário, marcar dia trabalhado
Moderador: Moderadores
- Itamar M. Lins Jr.
- Administrador

- Mensagens: 7928
- Registrado em: 30 Mai 2007 11:31
- Localização: Ilheus Bahia
- Curtiu: 1 vez
Calendário, marcar dia trabalhado
Olá!
Preciso de ideias para criar um calendário que a pessoa vai marcando o dia que "fulano" trabalhou.
Fulano: trabalhou 7,8,9,10 pulou 11,12 e continuou 13,14,15,16...
Com esses intervalos, a pessoa ir marcando com X por exemplo os dias que fulano trabalhou.
Criar um DBF com isso...
Saudações,
Itamar M. Lins Jr.
Preciso de ideias para criar um calendário que a pessoa vai marcando o dia que "fulano" trabalhou.
Fulano: trabalhou 7,8,9,10 pulou 11,12 e continuou 13,14,15,16...
Com esses intervalos, a pessoa ir marcando com X por exemplo os dias que fulano trabalhou.
Criar um DBF com isso...
Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Itamar M. Lins Jr.
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Calendário, marcar dia trabalhado
Eu não esqueço de uma agenda CASIO, que mostrava o calendário com duas marcas, pra manhã e tarde na data.
Não entendi exatamente o que quer, mas talvez aquele exemplo do Valteçom que atualizei.
Lá tanto faz se são mesas, quartos ou poderia ser datas.
Vou ver como converter pra hwgui.
No DBF, talvez cadastrar datas trabalhadas, um registro por data
Ou um registro por mes, com 31 caracteres indicando os dias, deixando em branco dias não trabalhados.
Não entendi exatamente o que quer, mas talvez aquele exemplo do Valteçom que atualizei.
Lá tanto faz se são mesas, quartos ou poderia ser datas.
Vou ver como converter pra hwgui.
No DBF, talvez cadastrar datas trabalhadas, um registro por data
Ou um registro por mes, com 31 caracteres indicando os dias, deixando em branco dias não trabalhados.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Calendário, marcar dia trabalhado
Esse daí, poderia conter os dias do mês.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- Itamar M. Lins Jr.
- Administrador

- Mensagens: 7928
- Registrado em: 30 Mai 2007 11:31
- Localização: Ilheus Bahia
- Curtiu: 1 vez
Calendário, marcar dia trabalhado
Olá!
Eu tenho isso em Hwgui. Mesas.
Mas acredito que já bolei aqui. Codigo + data (só isso) faz.
Vou usar CheckBox pra marcar., pensei em browse, mas um for next 1 to fimmes deve servir. para cada dia do ano e gravar só os marcados.
Com 12 abas(Jan/Fev/Mar...) no TAB!
Saudações,
Itamar M. Lins Jr.
Eu tenho isso em Hwgui. Mesas.
Mas acredito que já bolei aqui. Codigo + data (só isso) faz.
Vou usar CheckBox pra marcar., pensei em browse, mas um for next 1 to fimmes deve servir. para cada dia do ano e gravar só os marcados.
Com 12 abas(Jan/Fev/Mar...) no TAB!
Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Itamar M. Lins Jr.
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Calendário, marcar dia trabalhado
Acho que vai ter outra coisa pra pensar
Em janeiro, vai ter os dias de janeiro, e mais o ano anterior.
Talvez array bidimensional:
array[ mes, dia ] [ 12, 31 ]
aba mes 1, elemento 1, subelementos 1 a 31
ida e volta da data ano-mes-dia, parece que seria interessante.
Em janeiro, vai ter os dias de janeiro, e mais o ano anterior.
Talvez array bidimensional:
array[ mes, dia ] [ 12, 31 ]
aba mes 1, elemento 1, subelementos 1 a 31
ida e volta da data ano-mes-dia, parece que seria interessante.
Código: Selecionar todos
oCheckbox[ Month( Date() ), Day( Date() ) ]
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Calendário, marcar dia trabalhado
E no estilo do demoall kkkkk
É como um sample pra mostrar um mês
Depois um sample que reaproveita esse e mostra 12 meses.
E depois o sample do cadastro usando o dos 12 meses.
Dá pra usar a mesma idéia.
É como um sample pra mostrar um mês
Depois um sample que reaproveita esse e mostra 12 meses.
E depois o sample do cadastro usando o dos 12 meses.
Dá pra usar a mesma idéia.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Calendário, marcar dia trabalhado
Demofunc.prg como ponto de partida
Teria que ser owner button se quiser colorir.
Código: Selecionar todos
#include "hwgui.ch"
STATIC nRowPos := -1, nColPos := -1
FUNCTION OneMonth( lWithDialog, oDlg )
LOCAL nCont, xValue, oButton[31], dDatRef, nMes := 6
SET DATE BRITISH
hb_Default( @lWithDialog, .T. )
dDatRef := Stod("2025" + StrZero( nMes, 2 ) + "01") - 1
nColPos := -1
nRowPos := -1
IF lWithDialog
INIT DIALOG oDlg ;
TITLE "Test Month" ;
AT 1,1 ;
SIZE 770, 548 ;
STYLE WS_SYSMENU + WS_SIZEBOX + WS_VISIBLE
ENDIF
FOR nCont = 1 TO 31
FOR EACH xValue IN { nCont }
IF Month( dDatRef + xValue ) == 6
@ ColPos(), nRowPos BUTTON oButton[ xValue ] ;
CAPTION StrZero( xValue, 2 ) ;
SIZE 30, 30 ;
; // FONT oFont ;
STYLE WS_TABSTOP + BS_FLAT ;
ON CLICK { || Routine( dDatRef + xValue ) }
ENDIF
NEXT
NEXT
IF lWithDialog
ACTIVATE DIALOG oDlg CENTER
ENDIF
RETURN Nil
FUNCTION Routine( dData )
hwg_MsgInfo( Dtoc( dData ) )
RETURN Nil
STATIC FUNCTION ColPos()
IF nColPos == -1
nColPos := 20
nRowPos := 80
ELSE
nColPos += 50
IF nColPos > 350
nRowPos += 40 // LINE_HEIGHT
nColPos := 20
ENDIF
ENDIF
RETURN nColPos
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Calendário, marcar dia trabalhado
Código: Selecionar todos
#include "hwgui.ch"
FUNCTION OneYear( lWithDialog, oDlg )
LOCAL oTab, nCont
hb_Default( @lWithDialog, .T. )
IF lWithDialog
INIT DIALOG oDlg ;
TITLE "Test Month" ;
AT 1,1 ;
SIZE 770, 548 ;
STYLE WS_SYSMENU + WS_SIZEBOX + WS_VISIBLE
ENDIF
@ 20, 80 TAB oTab ;
ITEMS {} ;
OF oDlg ;
SIZE 504, 341 ;
STYLE WS_CHILD + WS_VISIBLE
FOR nCont = 1 TO 12
BEGIN PAGE "Mes " + Ltrim( Str( nCont ) ) OF oTab
OneMonth( .F., oTab )
END PAGE OF oTab
NEXT
IF lWithDialog
ACTIVATE DIALOG oDlg CENTER
ENDIF
RETURN Nil
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Calendário, marcar dia trabalhado
array de buttons e número do mês no primeiro, passado como parâmetro pro segundo
Com isso, o array completo está no primeiro.
Só trocar button por checkbox.
Código: Selecionar todos
#include "hwgui.ch"
FUNCTION OneYear( lWithDialog, oDlg )
LOCAL oTab, nCont, oButton[12,31]
hb_Default( @lWithDialog, .T. )
IF lWithDialog
INIT DIALOG oDlg ;
TITLE "Test Month" ;
AT 1,1 ;
SIZE 770, 548 ;
STYLE WS_SYSMENU + WS_SIZEBOX + WS_VISIBLE
ENDIF
@ 20, 80 TAB oTab ;
ITEMS {} ;
OF oDlg ;
SIZE 504, 341 ;
STYLE WS_CHILD + WS_VISIBLE
FOR nCont = 1 TO 12
BEGIN PAGE "Mes " + Ltrim( Str( nCont ) ) OF oTab
OneMonth( .F., oTab, oButton[ nCont ], nCont )
END PAGE OF oTab
NEXT
IF lWithDialog
ACTIVATE DIALOG oDlg CENTER
ENDIF
RETURN Nil
Código: Selecionar todos
#include "hwgui.ch"
STATIC nRowPos := -1, nColPos := -1
FUNCTION OneMonth( lWithDialog, oDlg, oButton, nMes )
LOCAL nCont, xValue, dDatRef
IF oButton == Nil
oButton := Array(31)
ENDIF
IF nMes == Nil
nMes := 6
ENDIF
SET DATE BRITISH
hb_Default( @lWithDialog, .T. )
dDatRef := Stod("2025" + StrZero( nMes, 2 ) + "01") - 1
nColPos := -1
nRowPos := -1
IF lWithDialog
INIT DIALOG oDlg ;
TITLE "Test Month" ;
AT 1,1 ;
SIZE 770, 548 ;
STYLE WS_SYSMENU + WS_SIZEBOX + WS_VISIBLE
ENDIF
FOR nCont = 1 TO 31
FOR EACH xValue IN { nCont }
IF Month( dDatRef + xValue ) == nMes
@ ColPos(), nRowPos BUTTON oButton[ xValue ] ;
CAPTION StrZero( xValue, 2 ) ;
SIZE 30, 30 ;
; // FONT oFont ;
STYLE WS_TABSTOP + BS_FLAT ;
ON CLICK { || Routine( dDatRef + xValue ) }
ENDIF
NEXT
NEXT
IF lWithDialog
ACTIVATE DIALOG oDlg CENTER
ENDIF
RETURN Nil
FUNCTION Routine( dData )
hwg_MsgInfo( Dtoc( dData ) )
RETURN Nil
STATIC FUNCTION ColPos()
IF nColPos == -1
nColPos := 20
nRowPos := 80
ELSE
nColPos += 50
IF nColPos > 350
nRowPos += 40 // LINE_HEIGHT
nColPos := 20
ENDIF
ENDIF
RETURN nColPos
Só trocar button por checkbox.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- Itamar M. Lins Jr.
- Administrador

- Mensagens: 7928
- Registrado em: 30 Mai 2007 11:31
- Localização: Ilheus Bahia
- Curtiu: 1 vez
Calendário, marcar dia trabalhado
Olá!
É por ai.
Amanhã, mando ver nas telas.
Saudações,
Itamar M. Lins Jr.
É por ai.
Amanhã, mando ver nas telas.
Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Itamar M. Lins Jr.
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Calendário, marcar dia trabalhado
Checkbox deu trabalho, foi difícil achar o erro.
Mas o erro era simples: tem dias 1 a 31, mas tem mês com 28 ou 30 dias, então tinha elemento Nil.
Mas o erro era simples: tem dias 1 a 31, mas tem mês com 28 ou 30 dias, então tinha elemento Nil.
Código: Selecionar todos
/*
onemonth.prg
*/
#include "hwgui.ch"
STATIC nRowPos := -1, nColPos := -1
FUNCTION OneMonth( lWithDialog, oDlg, oButton, nMes )
LOCAL nCont, xValue, dDatRef
IF oButton == Nil
oButton := Array(31)
ENDIF
IF nMes == Nil
nMes := 6
ENDIF
SET DATE BRITISH
hb_Default( @lWithDialog, .T. )
dDatRef := Stod("2025" + StrZero( nMes, 2 ) + "01") - 1
nColPos := -1
nRowPos := -1
IF lWithDialog
INIT DIALOG oDlg ;
TITLE "Test Month" ;
AT 1,1 ;
SIZE 770, 548 ;
STYLE WS_SYSMENU + WS_SIZEBOX + WS_VISIBLE
ENDIF
FOR nCont = 1 TO 31
FOR EACH xValue IN { nCont }
IF Month( dDatRef + xValue ) == nMes
/* button
@ ColPos(), nRowPos BUTTON oButton[ xValue ] ;
CAPTION StrZero( xValue, 2 ) ;
SIZE 30, 30 ;
; // FONT oFont ;
STYLE WS_TABSTOP + BS_FLAT ;
ON CLICK { || Routine( dDatRef + xValue ) }
*/
@ ColPos(), nRowPos CHECKBOX oButton[ xValue ] ;
CAPTION Ltrim( Str( xValue ) ) ;
SIZE 50, 30
ENDIF
NEXT
NEXT
IF lWithDialog
ACTIVATE DIALOG oDlg CENTER
ENDIF
RETURN Nil
STATIC FUNCTION ColPos()
IF nColPos == -1
nColPos := 20
nRowPos := 80
ELSE
nColPos += 50
IF nColPos > 350
nRowPos += 40 // LINE_HEIGHT
nColPos := 20
ENDIF
ENDIF
RETURN nColPos
Código: Selecionar todos
/*
oneyear.prg
*/
#include "hwgui.ch"
FUNCTION OneYear( lWithDialog, oDlg )
LOCAL oTab, nCont, oButton[ 12, 31 ], aItem
hb_Default( @lWithDialog, .T. )
FOR EACH aItem IN oButton
AFill( aItem, .F. )
NEXT
IF lWithDialog
INIT DIALOG oDlg ;
TITLE "Test Month" ;
AT 1,1 ;
SIZE 770, 548 ;
STYLE WS_SYSMENU + WS_SIZEBOX + WS_VISIBLE
ENDIF
@ 20, 80 TAB oTab ;
ITEMS {} ;
OF oDlg ;
SIZE 504, 341 ;
STYLE WS_CHILD + WS_VISIBLE
FOR nCont = 1 TO 12
BEGIN PAGE "Mes " + Ltrim( Str( nCont ) ) OF oTab
OneMonth( .F., oTab, oButton[ nCont ], nCont )
END PAGE OF oTab
NEXT
@ 30, 500 BUTTON "showAll" SIZE 100,20 ON CLICK { || Show(oButton) }
IF lWithDialog
ACTIVATE DIALOG oDlg CENTER
ENDIF
RETURN Nil
STATIC FUNCTION Show( aValue )
LOCAL cTxt := "", oMonth, oDay
FOR EACH oMonth IN aValue
FOR EACH oDay IN oMonth
IF ValType( oDay ) == "O" .AND. oDay:Value
cTxt += Dtoc( Stod( "2025" + StrZero( oMonth:__EnumIndex(), 2 ) + StrZero( oDay:__EnumIndex(), 2 ) ) ) + " "
ENDIF
NEXT
NEXT
hwg_MsgInfo( cTxt )
RETURN Nil
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Calendário, marcar dia trabalhado
a variável é só esta: local aButtons[12,31]
Ao passar pro mes, passo aButtons[ nMes ], vai o array por referência (default)
No checkbox, o FOR/EACH isola o contador
Acaba sendo tudo numa única variável, mesmo rotinas diferentes, em fontes diferentes.
Só teve o imprevisto dos dias 29,30,31, que não existem em todos os meses, e contém NIL e não um checkbox, conforme o mês.
Foi só contornar isso, e tudo bem.
Fica relativamente fácil de controlar, porque é só usar mes/ano oButton[7,24] vai ser o button pra 24 de julho.
Dá pra ajustar a posição do primeiro item da lista, e deixar em colunas por dia de semana.
Ao passar pro mes, passo aButtons[ nMes ], vai o array por referência (default)
No checkbox, o FOR/EACH isola o contador
Código: Selecionar todos
@ ColPos(), nRowPos CHECKBOX oButton[ xValue ] ;
CAPTION Ltrim( Str( xValue ) ) ;
SIZE 50, 30
Só teve o imprevisto dos dias 29,30,31, que não existem em todos os meses, e contém NIL e não um checkbox, conforme o mês.
Foi só contornar isso, e tudo bem.
Fica relativamente fácil de controlar, porque é só usar mes/ano oButton[7,24] vai ser o button pra 24 de julho.
Dá pra ajustar a posição do primeiro item da lista, e deixar em colunas por dia de semana.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- Itamar M. Lins Jr.
- Administrador

- Mensagens: 7928
- Registrado em: 30 Mai 2007 11:31
- Localização: Ilheus Bahia
- Curtiu: 1 vez
Calendário, marcar dia trabalhado
Olá!
Tem a função eom() não sei se é da CT que eu uso.
Saudações,
Itamar M. Lins Jr.
Código: Selecionar todos
FOR nCont = 1 TO 31Código: Selecionar todos
FOR nCount = 1 to eom() //(End OF Month)Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Itamar M. Lins Jr.
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Calendário, marcar dia trabalhado
Até agora só tratei dia e mês, ano tá fixo em 2025.
Teria que passar o ano então.
Novos ajustes:
Fica igual um calendário agora.
Usei o que tem no harbour, mas sem alterar language pra sair em português.
Teria que passar o ano então.
Novos ajustes:
Código: Selecionar todos
#include "hwgui.ch"
STATIC nRowPos := -1, nColPos := -1
FUNCTION OneMonth( lWithDialog, oDlg, oButton, nMes )
LOCAL nCont, xValue, dDatRef
IF oButton == Nil
oButton := Array(31)
ENDIF
IF nMes == Nil
nMes := 6
ENDIF
SET DATE BRITISH
hb_Default( @lWithDialog, .T. )
dDatRef := Stod("2025" + StrZero( nMes, 2 ) + "01") - 1
nColPos := -1
nRowPos := -1
IF lWithDialog
INIT DIALOG oDlg ;
TITLE "Test Month" ;
AT 1,1 ;
SIZE 770, 548 ;
STYLE WS_SYSMENU + WS_SIZEBOX + WS_VISIBLE
ENDIF
FOR nCont = 1 TO 7
@ 20 + ( ( nCont - 1 ) * 50 ), 40 SAY Left( CDOW( Stod( "20250601" ) + nCont ), 3 ) ;
SIZE 45, 30
NEXT
IF Dow( dDatRef - 1 ) != 7
FOR nCont = 1 TO Dow( dDatRef - 1 )
ColPos()
NEXT
ENDIF
FOR nCont = 1 TO 31
FOR EACH xValue IN { nCont }
IF Month( dDatRef + xValue ) == nMes
/* button
@ ColPos(), nRowPos BUTTON oButton[ xValue ] ;
CAPTION StrZero( xValue, 2 ) ;
SIZE 30, 30 ;
; // FONT oFont ;
STYLE WS_TABSTOP + BS_FLAT ;
ON CLICK { || Routine( dDatRef + xValue ) }
*/
@ ColPos(), nRowPos CHECKBOX oButton[ xValue ] ;
CAPTION Ltrim( Str( xValue ) ) ;
SIZE 50, 30
ENDIF
NEXT
NEXT
IF lWithDialog
ACTIVATE DIALOG oDlg CENTER
ENDIF
RETURN Nil
STATIC FUNCTION ColPos()
IF nColPos == -1
nColPos := 20
nRowPos := 80
ELSE
nColPos += 50
IF nColPos > 350
nRowPos += 40 // LINE_HEIGHT
nColPos := 20
ENDIF
ENDIF
RETURN nColPos
Usei o que tem no harbour, mas sem alterar language pra sair em português.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Calendário, marcar dia trabalhado
Esse esquema de reaproveitar, igual usei pra exemplos, é muito legal.
Ajustei mais um pouco, e agora são 3 fontes.
O básico: calendário de um mês, é usado em todos os outros, mas pode compilar sozinho.
O segundo que já tinha postado, ajustei pro nome do mês, e pra um ano.
É um ano inteiro em tabs, e chama o do mês 12 vezes.
E agora mais um, pra ano anterior, atual e seguinte.
Chama o fonte de ano 3 vezes.
Curiosidade:
HMG 3 e HMG Extended não fazem isso, o nível de tab é só um.
HWGUI, OOHG e FIVEWIN conseguem.
Lembrando que aqui poderia ser o cadastro do funcionário, com o ano em uma aba.
Pode não ser algo tão fora do comum usar mais tabs.
Ajustei mais um pouco, e agora são 3 fontes.
O básico: calendário de um mês, é usado em todos os outros, mas pode compilar sozinho.
Código: Selecionar todos
#include "hwgui.ch"
STATIC nRowPos := -1, nColPos := -1
FUNCTION OneMonth( lWithDialog, oDlg, oButton, dDate )
LOCAL nCont, xValue, dDatRef, nMes
hb_Default( @lWithDialog, .T. )
SET DATE BRITISH
IF oButton == Nil
oButton := Array(31)
ENDIF
IF dDate == Nil
dDate := Date()
ENDIF
dDatRef := dDate - 1
nMes := Month( dDate )
nColPos := -1
nRowPos := -1
IF lWithDialog
INIT DIALOG oDlg ;
TITLE "Test Month" ;
AT 1,1 ;
SIZE 770, 548 ;
STYLE WS_SYSMENU + WS_SIZEBOX + WS_VISIBLE
ENDIF
FOR nCont = 1 TO 7
@ 20 + ( ( nCont - 1 ) * 50 ), 40 SAY Left( CDOW( Stod( "20250601" ) + nCont ), 3 ) ;
SIZE 45, 30
NEXT
IF Dow( dDatRef - 1 ) != 7
FOR nCont = 1 TO Dow( dDatRef - 1 )
ColPos()
NEXT
ENDIF
FOR nCont = 1 TO 31
FOR EACH xValue IN { nCont }
IF Month( dDatRef + xValue ) == nMes
/* button
@ ColPos(), nRowPos BUTTON oButton[ xValue ] ;
CAPTION StrZero( xValue, 2 ) ;
SIZE 30, 30 ;
; // FONT oFont ;
STYLE WS_TABSTOP + BS_FLAT ;
ON CLICK { || Routine( dDatRef + xValue ) }
*/
@ ColPos(), nRowPos CHECKBOX oButton[ xValue ] ;
CAPTION Ltrim( Str( xValue ) ) ;
SIZE 50, 30
ENDIF
NEXT
NEXT
IF lWithDialog
ACTIVATE DIALOG oDlg CENTER
ENDIF
RETURN Nil
STATIC FUNCTION ColPos()
IF nColPos == -1
nColPos := 20
nRowPos := 80
ELSE
nColPos += 50
IF nColPos > 350
nRowPos += 40 // LINE_HEIGHT
nColPos := 20
ENDIF
ENDIF
RETURN nColPos
É um ano inteiro em tabs, e chama o do mês 12 vezes.
Código: Selecionar todos
/*
oneyear.prg
*/
#include "hwgui.ch"
FUNCTION OneYear( lWithDialog, oDlg, nYear )
LOCAL oTab, nCont, oButton[ 12, 31 ], aItem, dDate
hb_Default( @lWithDialog, .T. )
hb_Default( @nYear, 2025 )
FOR EACH aItem IN oButton
AFill( aItem, .F. )
NEXT
IF lWithDialog
INIT DIALOG oDlg ;
TITLE "Test Month" ;
AT 1,1 ;
SIZE 770, 548 ;
STYLE WS_SYSMENU + WS_SIZEBOX + WS_VISIBLE
ENDIF
@ 20, 80 TAB oTab ;
ITEMS {} ;
OF oDlg ;
SIZE 504, 341 ;
STYLE WS_CHILD + WS_VISIBLE
FOR nCont = 1 TO 12
dDate := Stod( StrZero( nYear, 4 ) + StrZero( nCont, 2 ) + "01" )
BEGIN PAGE CMonth( dDate ) OF oTab
OneMonth( .F., oTab, oButton[ nCont ], dDate )
END PAGE OF oTab
NEXT
@ 30, 500 BUTTON "showAll" SIZE 100,20 ON CLICK { || Show(oButton) }
IF lWithDialog
ACTIVATE DIALOG oDlg CENTER
ENDIF
RETURN Nil
STATIC FUNCTION Show( aValue )
LOCAL cTxt := "", oMonth, oDay
FOR EACH oMonth IN aValue
FOR EACH oDay IN oMonth
IF ValType( oDay ) == "O" .AND. oDay:Value
cTxt += Dtoc( Stod( "2025" + StrZero( oMonth:__EnumIndex(), 2 ) + StrZero( oDay:__EnumIndex(), 2 ) ) ) + " "
ENDIF
NEXT
NEXT
hwg_MsgInfo( cTxt )
RETURN Nil
Chama o fonte de ano 3 vezes.
Código: Selecionar todos
/*
test.prg
*/
#include "hwgui.ch"
FUNCTION Test()
LOCAL oDlg, oTab, nCont, nYear := 2025
INIT DIALOG oDlg ;
TITLE "Test Month" ;
AT 1,1 ;
SIZE 800, 600 ;
STYLE WS_SYSMENU + WS_SIZEBOX + WS_VISIBLE
@ 20, 10 TAB oTab ;
ITEMS {} ;
OF oDlg ;
SIZE 750, 550 ;
STYLE WS_CHILD + WS_VISIBLE
FOR nCont = 1 TO 3
BEGIN PAGE Str( nYear - 2 + nCont, 4 ) OF oTab
OneYear( .F., oTab, nYear - 2 + nCont )
END PAGE OF oTab
NEXT
ACTIVATE DIALOG oDlg CENTER
RETURN Nil
HMG 3 e HMG Extended não fazem isso, o nível de tab é só um.
HWGUI, OOHG e FIVEWIN conseguem.
Lembrando que aqui poderia ser o cadastro do funcionário, com o ano em uma aba.
Pode não ser algo tão fora do comum usar mais tabs.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/