Jump to content
Fivewin Brasil

Message em Dialog


Recommended Posts

Boa Tarde a todos

Pessoal como que ponho um "message" em um rodapé da dialog ?

colocar uma mensagem fixa eu consigo..

Mais pra colocar tipo um Help To apanhando mais do que vaca na orta e não to conseguindo.

dialog1.png

Há milhares de ano atrás eu perguntei isso aqui mais não achao o tópico icon_smile_big.gif

Obrigado..

Luiz Arruda

Corumbá - MS

ico.corumba@gmail.com

FiveWin 9.04

[x]Harbour

PellesC

Bcc

Ws

Retorne avisando se a dica funcionouid=red>

Para saber o que vem pela frente, fale com quem está voltando

Link to comment
Share on other sites

Boa Tarde a todos

Pessoal como que ponho um "message" em um rodapé da dialog ?

colocar uma mensagem fixa eu consigo..

Mais pra colocar tipo um Help To apanhando mais do que vaca na orta e não to conseguindo.

dialog1.png

Há milhares de ano atrás eu perguntei isso aqui mais não achao o tópico icon_smile_big.gif

Obrigado..

Luiz Arruda

Corumbá - MS

ico.corumba@gmail.com

FiveWin 9.04

[x]Harbour

PellesC

Bcc

Ws

Retorne avisando se a dica funcionouid=red>

Para saber o que vem pela frente, fale com quem está voltando

Link to comment
Share on other sites

No on Init do dialogo....


****************************************************************************

static procedure CriaBarraPesquisa()

****************************************************************************

*

* Criar a barra na tela de pesquisa

* Parametros:

* Retorno: Nenhum

*

* Autor: Samir

* 28/5/2010 - 08:46:16

*

****************************************************************************

Local oFont

Define Font oFont Name "Tahoma"

Set Message;

of oDlgPesq;

2007;

CENTERED;

Font oFont

oGet:cToolTip := "F2 Ativa/Desativa" +CRLF+;

"F3 Próximo" +CRLF

If Alias() = "CLIENTES" .Or. Alias() = "ESTOQUE"

AtualizaBarraPesquisa(1,"Pesquisa avançada = Desativada",;

"F2 Ativa/Desativa" +CRLF+;

"F3 Próximo" )

AtualizaBarraPesquisa(2,"Filtro desativado",;

"F4 Ativa filtro" +CRLF+;

"F5 Desativa filtro")

oGet:cToolTip += "F4 Ativa filtro" +CRLF+;

"F5 Desativa filtro" +CRLF

If Alias() = "ESTOQUE"

AtualizaBarraPesquisa(3,"Todos os itens",;

"F6 Ativa filtro por marca" +CRLF+;

"F7 Desativa filtro por marca")

oGet:cToolTip += "F6 Ativa filtro por marca" +CRLF+;

"F7 Desativa filtro por marca"

end

else

AtualizaBarraPesquisa(1,"Pesquisa avançada = Indisponivel")

end

oDlgPesq:oMsgBar:cToolTip := oGet:cToolTip

oDlgPesq:oMsgBar:Refresh()

Return Nil

/*------------------------------------------------------------------------*/

****************************************************************************

procedure AtualizaBarraPesquisa(nCol, cTexto, cTooltip)

****************************************************************************

*

* Atualizar a barra da pesquisa

* Parametros: nCol, cTexto, cTooltip

* Retorno: Nenhum

*

* Autor: Samir

* 27/5/2010 - 14:01:49

*

****************************************************************************

Default nCol := 1, cTexto := "", cTooltip := ""

While Len(aItemMsgbar) < nCol

aAdd(aItemMsgBar,nil)

end

If ValType(aItemMsgbar[nCol]) != "O"

Define MsgItem aItemMsgbar[nCol];

of oDlgPesq:oMsgBar;

Prompt cTexto;

Size Round(oDlgPesq:GetWidth(cTexto)*1.3,0);

ToolTip cToolTip

else

If !Empty(cTexto)

aItemMsgbar[nCol]:SetText(cTexto)

aItemMsgbar[nCol]:nWidth := Round(oDlgPesq:GetWidth(cTexto)*1.3,0)

end

If !Empty(cToolTip)

aItemMsgbar[nCol]:cToolTip := cToolTip

end

end

oDlgPesq:oMsgBar:nItem := nCol

oDlgPesq:oMsgBar:Refresh()

Return Nil

/*------------------------------------------------------------------------*/

id=code>id=code>

SamirSSabreu@gmail.com

samirabreu@hotmail.com

Skype: SamirAbreu

xHarbour 1.10/1.21 + FwXh 8.02/10.6

"Acreditar é mais fácil do que pensar: Daí existem muito mais crentes do que pensadores.†Bruce Calvert

Link to comment
Share on other sites

citação:

Pode ser usando DYNAMIC SAY ??

João Santos - São Paulo.

kmt_karinha@pop.com.br

joao@pleno.com.br

Fone: (11) 3106-2832 / 8243-5632 - TIM

FWH 2.7 - xHARBOUR WorkShop.Exe

dentinho.jpg?rnd=0.830315402649066


id=quote>id=quote>

Pode... se for com "MENAS" linhas do exemplo do Samir eu testo icon_smile_big.gif

Abraços..

Luiz Arruda

Corumbá - MS

ico.corumba@gmail.com

FiveWin 9.04

[x]Harbour

PellesC

Bcc

Ws

Retorne avisando se a dica funcionouid=red>

Para saber o que vem pela frente, fale com quem está voltando

Link to comment
Share on other sites


****************************************************************************

static procedure CriaBarraPesquisa()

****************************************************************************

*

* Criar a barra na tela de pesquisa

* Parametros:

* Retorno: Nenhum

*

* Autor: Samir

* 28/5/2010 - 08:46:16

*

****************************************************************************

Local oFont

Define Font oFont Name "Tahoma"

Set Message;

of oDlgPesq;

2007;

CENTERED;

Font oFont

AtualizaBarraPesquisa(1,"Primeiro item")

AtualizaBarraPesquisa(2,"Segundo item")

oDlgPesq:oMsgBar:cToolTip := oGet:cToolTip

oDlgPesq:oMsgBar:Refresh()

Return Nil

/*------------------------------------------------------------------------*/

****************************************************************************

procedure AtualizaBarraPesquisa(nCol, cTexto, cTooltip)

****************************************************************************

*

* Atualizar a barra da pesquisa

* Parametros: nCol, cTexto, cTooltip

* Retorno: Nenhum

*

* Autor: Samir

* 27/5/2010 - 14:01:49

*

****************************************************************************

Default nCol := 1, cTexto := "", cTooltip := ""

While Len(aItemMsgbar) < nCol

aAdd(aItemMsgBar,nil)

end

If ValType(aItemMsgbar[nCol]) != "O"

Define MsgItem aItemMsgbar[nCol];

of oDlgPesq:oMsgBar;

Prompt cTexto;

Size Round(oDlgPesq:GetWidth(cTexto)*1.3,0);

ToolTip cToolTip

else

If !Empty(cTexto)

aItemMsgbar[nCol]:SetText(cTexto)

aItemMsgbar[nCol]:nWidth := Round(oDlgPesq:GetWidth(cTexto)*1.3,0)

end

If !Empty(cToolTip)

aItemMsgbar[nCol]:cToolTip := cToolTip

end

end

oDlgPesq:oMsgBar:nItem := nCol

oDlgPesq:oMsgBar:Refresh()

Return Nil

/*------------------------------------------------------------------------*/

id=code>id=code>

SamirSSabreu@gmail.com

samirabreu@hotmail.com

Skype: SamirAbreu

xHarbour 1.10/1.21 + FwXh 8.02/10.6

"Acreditar é mais fácil do que pensar: Daí existem muito mais crentes do que pensadores.†Bruce Calvert

Link to comment
Share on other sites

ACTIVATE DIALOG oDlg[1] Valid noESC[1] ON Init(BarraBotoes(oDlg[1]) )


**--[ Barra de botoes (ToolBar) ]--**

STATIC FUNCTION BarraBotoes()

**---------------------------------**

PRIVATE oImageList

DEFINE IMAGELIST oImageList SIZE 22,22

DEFINE IMGBITMAP OF oImageList NAME "NOVO22" COLOR nRGB( 255, 0, 255 )

DEFINE IMGBITMAP OF oImageList NAME "SALVAR22" COLOR nRGB( 255, 0, 255 )

DEFINE IMGBITMAP OF oImageList NAME "EXCLUIR22" COLOR nRGB( 255, 0, 255 )

DEFINE IMGBITMAP OF oImageList NAME "RECUPERAR22" COLOR nRGB( 255, 0, 255 )

DEFINE IMGBITMAP OF oImageList NAME "PROCURAR22" COLOR nRGB( 255, 0, 255 )

DEFINE IMGBITMAP OF oImageList NAME "SAIR22" COLOR nRGB( 255, 0, 255 )

DEFINE TOOLBAR oToolBar OF oDlg[1] SIZE 48,48 IMAGELIST oImageList BALLOON

oToolBar:SetTextRows( 2 )

DEFINE TBSEPARATOR OF oToolBar

DEFINE TBBUTTON OF oToolBar ;

PROMPT "Novo" ;

ACTION(NovoRegistro())

DEFINE TBBUTTON OF oToolBar ;

PROMPT "Salvar" ;

ACTION(SalvarDados())

DEFINE TBBUTTON OF oToolBar ;

PROMPT "Excluir" ;

ACTION(ExcluirRegistro())

DEFINE TBBUTTON OF oToolBar ;

PROMPT "Recuperar" ;

ACTION(RecuperarRegistro())

DEFINE TBMENU OF oToolBar ;

PROMPT "Localizar" ;

MENU mBotLocCli() ;

ACTION(LocalizarCliente())

DEFINE TBBUTTON OF oToolBar ;

PROMPT "Sair" ;

ACTION(noESC[1]:=.t.,oDlg[1]:End() )

DEFINE MESSAGE oMsgBar OF oDlg[1] PROMPT "" COLOR VERMELHO FONT fItal

DEFINE MsgItem oItemExcl OF oDLG[1]:oMsgBar BITMAP "DelReg16" Pixel Size 90 COLOR AZUL FONT fItal Prompt "Excluídos"

DEFINE MsgItem oItemHelp OF oDlg[1]:oMsgBar BITMAP "HELP16" Pixel Size 26 COLOR AZUL FONT fItal TOOLTIP "Para obter ajuda, somente posicione o mouse sobre o campo desejado." //ACTION(VerOcorrencias("AGE",StrZero(AGENDA->codage,6),oDlg[1]))

DEFINE MsgItem oItemInfo OF oDlg[1]:oMsgBar BITMAP "OLHOS16" Pixel Size 26 COLOR AZUL FONT fItal TOOLTIP "Atualizações efetuadas no registro selecionado" ACTION(Auditoria("CLI",CLI->codcli,CLI->nomcli,oDlg[1]))

oMsgBar:ClockOn()

oMsgBar:nHeight:=27

RETURN(NIL)

id=code>id=code>

RodapeEmail.JPG

"Me interessa o futuro porque é o lugar onde vou

passar o resto da minha vida."

Link to comment
Share on other sites

citação:

ACTIVATE DIALOG oDlg[1] Valid noESC[1] ON Init(BarraBotoes(oDlg[1]) )


**--[ Barra de botoes (ToolBar) ]--**

STATIC FUNCTION BarraBotoes()

**---------------------------------**

PRIVATE oImageList

DEFINE IMAGELIST oImageList SIZE 22,22

DEFINE IMGBITMAP OF oImageList NAME "NOVO22" COLOR nRGB( 255, 0, 255 )

DEFINE IMGBITMAP OF oImageList NAME "SALVAR22" COLOR nRGB( 255, 0, 255 )

DEFINE IMGBITMAP OF oImageList NAME "EXCLUIR22" COLOR nRGB( 255, 0, 255 )

DEFINE IMGBITMAP OF oImageList NAME "RECUPERAR22" COLOR nRGB( 255, 0, 255 )

DEFINE IMGBITMAP OF oImageList NAME "PROCURAR22" COLOR nRGB( 255, 0, 255 )

DEFINE IMGBITMAP OF oImageList NAME "SAIR22" COLOR nRGB( 255, 0, 255 )

DEFINE TOOLBAR oToolBar OF oDlg[1] SIZE 48,48 IMAGELIST oImageList BALLOON

oToolBar:SetTextRows( 2 )

DEFINE TBSEPARATOR OF oToolBar

DEFINE TBBUTTON OF oToolBar ;

PROMPT "Novo" ;

ACTION(NovoRegistro())

DEFINE TBBUTTON OF oToolBar ;

PROMPT "Salvar" ;

ACTION(SalvarDados())

DEFINE TBBUTTON OF oToolBar ;

PROMPT "Excluir" ;

ACTION(ExcluirRegistro())

DEFINE TBBUTTON OF oToolBar ;

PROMPT "Recuperar" ;

ACTION(RecuperarRegistro())

DEFINE TBMENU OF oToolBar ;

PROMPT "Localizar" ;

MENU mBotLocCli() ;

ACTION(LocalizarCliente())

DEFINE TBBUTTON OF oToolBar ;

PROMPT "Sair" ;

ACTION(noESC[1]:=.t.,oDlg[1]:End() )

DEFINE MESSAGE oMsgBar OF oDlg[1] PROMPT "" COLOR VERMELHO FONT fItal

DEFINE MsgItem oItemExcl OF oDLG[1]:oMsgBar BITMAP "DelReg16" Pixel Size 90 COLOR AZUL FONT fItal Prompt "Excluídos"

DEFINE MsgItem oItemHelp OF oDlg[1]:oMsgBar BITMAP "HELP16" Pixel Size 26 COLOR AZUL FONT fItal TOOLTIP "Para obter ajuda, somente posicione o mouse sobre o campo desejado." //ACTION(VerOcorrencias("AGE",StrZero(AGENDA->codage,6),oDlg[1]))

DEFINE MsgItem oItemInfo OF oDlg[1]:oMsgBar BITMAP "OLHOS16" Pixel Size 26 COLOR AZUL FONT fItal TOOLTIP "Atualizações efetuadas no registro selecionado" ACTION(Auditoria("CLI",CLI->codcli,CLI->nomcli,oDlg[1]))

oMsgBar:ClockOn()

oMsgBar:nHeight:=27

RETURN(NIL)

id=code>id=code>

RodapeEmail.JPG

"Me interessa o futuro porque é o lugar onde vou

passar o resto da minha vida."


id=quote>id=quote>

ESTE EXEMPLO DO SÉRGIO, PARECE PERFEITO, GOSTEI MUITO.

João Santos - São Paulo.

kmt_karinha@pop.com.br

joao@pleno.com.br

Fone: (11) 3106-2832 / 8243-5632 - TIM

FWH 2.7 - xHARBOUR WorkShop.Exe

dentinho.jpg?rnd=0.830315402649066

Link to comment
Share on other sites

citação:

citação:

ACTIVATE DIALOG oDlg[1] Valid noESC[1] ON Init(BarraBotoes(oDlg[1]) )


**--[ Barra de botoes (ToolBar) ]--**

STATIC FUNCTION BarraBotoes()

**---------------------------------**

PRIVATE oImageList

DEFINE IMAGELIST oImageList SIZE 22,22

DEFINE IMGBITMAP OF oImageList NAME "NOVO22" COLOR nRGB( 255, 0, 255 )

DEFINE IMGBITMAP OF oImageList NAME "SALVAR22" COLOR nRGB( 255, 0, 255 )

DEFINE IMGBITMAP OF oImageList NAME "EXCLUIR22" COLOR nRGB( 255, 0, 255 )

DEFINE IMGBITMAP OF oImageList NAME "RECUPERAR22" COLOR nRGB( 255, 0, 255 )

DEFINE IMGBITMAP OF oImageList NAME "PROCURAR22" COLOR nRGB( 255, 0, 255 )

DEFINE IMGBITMAP OF oImageList NAME "SAIR22" COLOR nRGB( 255, 0, 255 )

DEFINE TOOLBAR oToolBar OF oDlg[1] SIZE 48,48 IMAGELIST oImageList BALLOON

oToolBar:SetTextRows( 2 )

DEFINE TBSEPARATOR OF oToolBar

DEFINE TBBUTTON OF oToolBar ;

PROMPT "Novo" ;

ACTION(NovoRegistro())

DEFINE TBBUTTON OF oToolBar ;

PROMPT "Salvar" ;

ACTION(SalvarDados())

DEFINE TBBUTTON OF oToolBar ;

PROMPT "Excluir" ;

ACTION(ExcluirRegistro())

DEFINE TBBUTTON OF oToolBar ;

PROMPT "Recuperar" ;

ACTION(RecuperarRegistro())

DEFINE TBMENU OF oToolBar ;

PROMPT "Localizar" ;

MENU mBotLocCli() ;

ACTION(LocalizarCliente())

DEFINE TBBUTTON OF oToolBar ;

PROMPT "Sair" ;

ACTION(noESC[1]:=.t.,oDlg[1]:End() )

DEFINE MESSAGE oMsgBar OF oDlg[1] PROMPT "" COLOR VERMELHO FONT fItal

DEFINE MsgItem oItemExcl OF oDLG[1]:oMsgBar BITMAP "DelReg16" Pixel Size 90 COLOR AZUL FONT fItal Prompt "Excluídos"

DEFINE MsgItem oItemHelp OF oDlg[1]:oMsgBar BITMAP "HELP16" Pixel Size 26 COLOR AZUL FONT fItal TOOLTIP "Para obter ajuda, somente posicione o mouse sobre o campo desejado." //ACTION(VerOcorrencias("AGE",StrZero(AGENDA->codage,6),oDlg[1]))

DEFINE MsgItem oItemInfo OF oDlg[1]:oMsgBar BITMAP "OLHOS16" Pixel Size 26 COLOR AZUL FONT fItal TOOLTIP "Atualizações efetuadas no registro selecionado" ACTION(Auditoria("CLI",CLI->codcli,CLI->nomcli,oDlg[1]))

oMsgBar:ClockOn()

oMsgBar:nHeight:=27

RETURN(NIL)

id=code>id=code>

RodapeEmail.JPG

"Me interessa o futuro porque é o lugar onde vou

passar o resto da minha vida."


id=quote>id=quote>

ESTE EXEMPLO DO SÉRGIO, PARECE PERFEITO, GOSTEI MUITO.

João Santos - São Paulo.

kmt_karinha@pop.com.br

joao@pleno.com.br

Fone: (11) 3106-2832 / 8243-5632 - TIM

FWH 2.7 - xHARBOUR WorkShop.Exe

dentinho.jpg?rnd=0.830315402649066


id=quote>id=quote>

Tb. Achei.. mais não uso ToolBar e não vi a Func NoEsc[1]

Valeu Pessoal.

Luiz Arruda

Corumbá-MS

ico.corumba@gmail.com

21182795.png

FiveWin 9.04

[x]Harbour

PellesC

Bcc Ws

Para saber o que vem pela frente, fale com quem está voltando

Link to comment
Share on other sites

Documentando para quem for fazer Helps.

Pode ser:

http://www.fivewin.com.br/exibedicas.asp?id=580

http://www.fivewin.com.br/exibedicas.asp?id=683

http://www.fivewin.com.br/exibedicas.asp?id=276

Ou simplesmente crio um banco de dados e permito que o próprio usário escreva o seu HELP.

João Santos - São Paulo.

kmt_karinha@pop.com.br

joao@pleno.com.br

Fone: (11) 3106-2832 / 8243-5632 - TIM

FWH 2.7 - xHARBOUR WorkShop.Exe

dentinho.jpg?rnd=0.830315402649066

Link to comment
Share on other sites

Fez pidada da sexta aqui??? kkkkkkkk

E Esse VERDE ahi, ficou bão não heim???

CORITIBA 6 x 0 PALMEIRAS

KKKKKKKKKKKKKKKKKKKKKKKK

João Santos - São Paulo.

kmt_karinha@pop.com.br

joao@pleno.com.br

Fone: (11) 3106-2832 / 8243-5632 - TIM

FWH 2.7 - xHARBOUR WorkShop.Exe

dentinho.jpg?rnd=0.830315402649066

Link to comment
Share on other sites

citação:

Fez pidada da sexta aqui??? kkkkkkkk

E Esse VERDE ahi, ficou bão não heim???

CORITIBA 6 x 0 PALMEIRAS

KKKKKKKKKKKKKKKKKKKKKKKK

João Santos - São Paulo.

kmt_karinha@pop.com.br

joao@pleno.com.br

Fone: (11) 3106-2832 / 8243-5632 - TIM

FWH 2.7 - xHARBOUR WorkShop.Exe

dentinho.jpg?rnd=0.830315402649066


id=quote>id=quote>

http://www.fivewin.com.br/forum/topic.asp?TOPIC_ID=18718&whichpage=2&ARCHIVE= icon_smile_big.gif

Luiz Arruda

Corumbá-MS

ico.corumba@gmail.com

21182795.png

FiveWin 9.04

[x]Harbour

PellesC

Bcc Ws

Para saber o que vem pela frente, fale com quem está voltando

Link to comment
Share on other sites

Poder isso tabem :

Set Message Of oWnd To "Aqui ó ó ó ó" Clock Date Keyboard FONT oFont0 COLOR RGB(0,0,255)

________________________

Gilberto Herminio - Analista de Desenvolvimento de Sistemas

Mogi das Cruzes-SP

xHB121+Fw912 / C#/SQL2008

"Não Desenvolvo Software, crio arte Binaria...."

Link to comment
Share on other sites

citação:

Poder isso tabem :

Set Message Of oWnd To "Aqui ó ó ó ó" Clock Date Keyboard FONT oFont0 COLOR RGB(0,0,255)

________________________

Gilberto Herminio - Analista de Desenvolvimento de Sistemas

Mogi das Cruzes-SP

xHB121+Fw912 / C#/SQL2008

"Não Desenvolvo Software, crio arte Binaria...."


id=quote>id=quote>

Gilberto..

Apesar de que não vou mais usar mais como dito acima. vai uma correção

Desta Forma que vc. postou funciona na Window e eu tava procurando para usar em Dialog.. Veja a figurinha lááááá em cima icon_smile_big.gif

Abraços..

Luiz Arruda

Corumbá-MS

ico.corumba@gmail.com

21182795.png

FiveWin 9.04

[x]Harbour

PellesC

Bcc Ws

Para saber o que vem pela frente, fale com quem está voltando

Link to comment
Share on other sites

Kapi, veja no rodape, que a versão é de 2009 e não é usada mais.

Hoje seria este visual, mas já estou estudando mudanças.

cc1.png

RodapeEmail.JPG

"Me interessa o futuro porque é o lugar onde vou

passar o resto da minha vida."

Editado por - S.A.Oliveira on 06/05/2011 17:29:24

Link to comment
Share on other sites

citação:Tá mesmo bonito.. aqueles group´s em "alto relevo" é o meu sonho de consumo
id=quote>id=quote>

Luiz,

Teste o código abaixo:


********************************************************************

#Include "Fivewin.ch"

//------------------------------------------------------------------

Function Main()

define Font oFont Name "Ms Sans Serif" Size 7, 14

define dialog oDlg title "Teste Frame" From 0,0 to 600, 600 pixel;

COLOR 0, CLR_WHITE

activate dialog oDlg Center ON Paint MeuGroup( oDlg )

Return NIL

//------------------------------------------------------------------

Function MeuGroup( oDlg )

RGroup( 20, 50, 200, 250, oDlg, CLR_HBLUE)

RGroup( 20, 300, 200, 550, oDlg, CLR_HGRAY )

RGroup( 300, 50, 500, 250, oDlg, CLR_RED )

RGroup( 300, 300, 500, 550, oDlg, CLR_GREEN )

Return NIL

//------------------------------------------------------------------

Function RGroup( nRow, nCol, nRowF, nColF, oDlg, nCor )

local hPen, i, nR, nG, nB

oDlg:GetDC()

hPen := CreatePen( 0, 1, nCor )

hOldPen := SelectObject( oDlg:hDc, hPen )

MoveTo( oDlg:hDC, nCol, nRow )

LineTo( oDlg:hDC, nColF, nRow )

LineTo( oDlg:hDC, nColF, nRowF )

LineTo( oDlg:hDC, nCol, nRowF )

LineTo( oDlg:hDC, nCol, nRow )

SelectObject( oDlg:hDc, hOldPen )

DeleteObject( hPen )

nR := nRGBRed(nCor)

nG := nRGBGreen(nCor)

nB := nRGBBlue(nCor)

nR += (255-nR)*0.8

nG += (255-nG)*0.8

nB += (255-nB)*0.8

if nR > 255

nR := 255

endif

if nG > 255

nG := 255

endif

if nB > 255

nB := 255

endif

nCor := nRGB( nR, nG, nB)

for i := 1 to 4

hPen := CreatePen( 0, 1, nRGB( nR, nG, nB ) )

hOldPen := SelectObject( oDlg:hDc, hPen )

MoveTo( oDlg:hDC, nCol+i, nRow+i )

LineTo( oDlg:hDC, nColF-i, nRow+i )

LineTo( oDlg:hDC, nColF-i, nRowF-i )

LineTo( oDlg:hDC, nCol+i, nRowF-i )

LineTo( oDlg:hDC, nCol+i, nRow+i )

SelectObject( oDlg:hDc, hOldPen )

DeleteObject( hPen )

nR := nRGBRed(nCor)

nG := nRGBGreen(nCor)

nB := nRGBBlue(nCor)

nR -= (255-nR)*(0.9*i)

nG -= (255-nG)*(0.9*i)

nB -= (255-nB)*(0.9*i)

if nR < 0

nR := 0

endif

if nG < 0

nG := 0

endif

if nB < 0

nB := 0

endif

next

Return NIL

********************************************************************

id=code>id=code>

Veja o resultado:

19305070.jpg

assinatura.png

Link to comment
Share on other sites

citação:Para melhorar, tambem poder definir a cor do centro do group.
id=quote>id=quote>

Que tal então:

- Poder escolher qual cor eu quero no fundo

- Com ou sem degrade

- Definir a taxa de degrade

19305197.jpg

Entenda a chamada da função:


onde:

nRow - Linha inicial

nCol - Coluna inicial

nRowF - linha final

nColF - Coluna Final

oWnd - Objeto da janela

nCorBorda - Cor da borda

nCorFundo - Cor de fundo (Opcional)- Default = Cor da Borda

lDegrade - Se TRUE com degrade, se não UNIFORME (opcional) - Default = .F.

nDegrade - Taxa do degrade (Opcional) = Defualt = 100%

id=code>id=code>

Aí segue o código com as implementações:


********************************************************************

#Include "Fivewin.ch"

//------------------------------------------------------------------

Function Main()

define Font oFont Name "Ms Sans Serif" Size 7, 14

define dialog oDlg title "Teste Frame" From 0,0 to 600, 900 pixel;

COLOR 0, CLR_WHITE

activate dialog oDlg Center ON Paint MeuGroup( oDlg )

Return NIL

//------------------------------------------------------------------

Function MeuGroup( oDlg )

RGroup( 20, 50, 200, 250, oDlg, nRGB(210,210,210) )

RGroup( 20, 300, 200, 550, oDlg, CLR_HBLUE, CLR_HBLUE, .t. )

RGroup( 300, 50, 500, 250, oDlg, CLR_RED, nRGB(255,255,13) )

RGroup( 300, 300, 500, 550, oDlg, CLR_GREEN, ,.t. )

RGroup( 20, 600, 200, 850, oDlg, CLR_HBLUE, CLR_HBLUE, .t., 10 )

RGroup( 300, 600, 500, 850, oDlg, CLR_GREEN, ,.t., 30 )

Return NIL

//------------------------------------------------------------------

Function RGroup( nRow, nCol, nRowF, nColF, oDlg, nCor, nCorFundo, lDeg, nDeg )

local hPen, i, nR, nG, nB, nInd

Default lDeg := .f.

Default nCorFundo := nCor

Default nDeg := 100

oDlg:GetDC()

hPen := CreatePen( 0, 1, nCor )

hOldPen := SelectObject( oDlg:hDc, hPen )

MoveTo( oDlg:hDC, nCol, nRow )

LineTo( oDlg:hDC, nColF, nRow )

LineTo( oDlg:hDC, nColF, nRowF )

LineTo( oDlg:hDC, nCol, nRowF )

LineTo( oDlg:hDC, nCol, nRow )

SelectObject( oDlg:hDc, hOldPen )

DeleteObject( hPen )

nR := nRGBRed(nCor)

nG := nRGBGreen(nCor)

nB := nRGBBlue(nCor)

nR += (255-nR)*0.8

nG += (255-nG)*0.8

nB += (255-nB)*0.8

if nR > 255

nR := 255

endif

if nG > 255

nG := 255

endif

if nB > 255

nB := 255

endif

nCor := nRGB( nR, nG, nB)

for i := 1 to 4

hPen := CreatePen( 0, 1, nRGB( nR, nG, nB ) )

hOldPen := SelectObject( oDlg:hDc, hPen )

MoveTo( oDlg:hDC, nCol+i, nRow+i )

LineTo( oDlg:hDC, nColF-i, nRow+i )

LineTo( oDlg:hDC, nColF-i, nRowF-i )

LineTo( oDlg:hDC, nCol+i, nRowF-i )

LineTo( oDlg:hDC, nCol+i, nRow+i )

SelectObject( oDlg:hDc, hOldPen )

DeleteObject( hPen )

nR := nRGBRed(nCor)

nG := nRGBGreen(nCor)

nB := nRGBBlue(nCor)

nR -= (255-nR)*(0.9*i)

nG -= (255-nG)*(0.9*i)

nB -= (255-nB)*(0.9*i)

if nR < 0

nR := 0

endif

if nG < 0

nG := 0

endif

if nB < 0

nB := 0

endif

next

nInd := (255/(nRowf-nRow))/nDeg

nR := nRGBRed(nCorFundo)

nG := nRGBGreen(nCorFundo)

nB := nRGBBlue(nCorFundo)

nCol+=5

nRow+=5

nColf-=5

nRowf-=5

do while .t.

hPen := CreatePen( 0, 1, nRGB( nR, nG, nB ) )

hOldPen := SelectObject( oDlg:hDc, hPen )

MoveTo( oDlg:hDC, nCol, nRow )

LineTo( oDlg:hDC, nColF, nRow )

LineTo( oDlg:hDC, nColF, nRowF )

LineTo( oDlg:hDC, nCol, nRowF )

LineTo( oDlg:hDC, nCol, nRow )

SelectObject( oDlg:hDc, hOldPen )

DeleteObject( hPen )

if nCol = nColF .and. nRow = nRowF

Exit

endif

if lDeg

nR += (255-nR)*nInd

nG += (255-nG)*nInd

nB += (255-nB)*nInd

if nR > 255

nR := 255

endif

if nG > 255

nG := 255

endif

if nB > 255

nB := 255

endif

endif

nRow++

if nRow > nRowF

nRow := nRowF

endif

nCol++

if nCol > nColF

nCol := nColF

endif

nRowF--

if nRowF < nRow

nRowF := nRow

endif

nColF--

if nColF < nCol

nColF := nCol

endif

enddo

hPen := CreatePen( 0, 1, nRGB( nR, nG, nB ) )

hOldPen := SelectObject( oDlg:hDc, hPen )

MoveTo( oDlg:hDC, nCol, nRow )

LineTo( oDlg:hDC, nColF-1, nRow )

LineTo( oDlg:hDC, nColF, nRowF )

LineTo( oDlg:hDC, nCol, nRowF )

LineTo( oDlg:hDC, nCol, nRow )

SelectObject( oDlg:hDc, hOldPen )

DeleteObject( hPen )

Return NIL

********************************************************************

id=code>id=code>

assinatura.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...