Dear Antonio and friends,
It's possible to create a new "get" object at bottom of xBrowse? With the width of it?
But in runtime!!
JĂșlio CĂ©sar M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Dear Antonio and friends,
It's possible to create a new "get" object at bottom of xBrowse? With the width of it?
But in runtime!!
::oBrwGet := TGet():new( 0, 0,{ | u | If(PCount()==0,::uBrwGet,::uBrwGet:= u ) }, ::oWnd,0,0,"@!",,,,,.F.,,.F.,,.F.,,,,,.F.,.f.,.T.,,.F.,,,,)
::oBrwGet:Move( ::nBottom, ::nLeft, ::nWidth, ::nHeight, .T. )Application
===========
Path and name: C:\apps\test.EXE (32 bits)
Size: 1,949,696 bytes
Time from start: 0 hours 0 mins 37 secs
Error occurred at: 22/12/2008, 14:20:06
Error description: Error FiveWin/1 Non defined Id: No: 104
Stack Calls
===========
Called from: .\source\classes\CONTROL.PRG => TCONTROL:INITIATE(0)
Called from: C:\RepositorioLocal\extras\tget.prg => TGET:INITIATE(563)
Called from: => __OBJSENDMSG(0)
Called from: .\source\function\HARBOUR.PRG => OSEND(0)
Called from: .\source\function\HARBOUR.PRG => ASEND(0)
Called from: C:\RepositorioLocal\extras\dialog.prg => TDIALOG:INITIATE(702)
Called from: C:\RepositorioLocal\extras\dialog.prg => TDIALOG:HANDLEEVENT(954)
Called from: => DIALOGBOX(0)
Called from: C:\RepositorioLocal\extras\dialog.prg => TDIALOG:ACTIVATE(273)I simply treat the as odbf:eof() ,as : go bottom ,skip (1)
oCol := obrow:AddCol()
oCol:bStrData := {||odb2:stockid}
oCol:cHeader := "编号"
oCol:bEditValue := {||odb2:stockid}
oCol:nEditType := {||if(ledit,1,0)}
oCol:bOnPostEdit := {|o, v, n| if( n != VK_ESCAPE .and. v != odb2:stockid,;
(if(odb2:EOF(),;
(odb2:stockid:=v,odb2:lmrp:="Y",odb2:APPEND(),obrow:refresh(),if(!oserver:lerror,obrow:SEEK(v),msgstop("编号重复!","停止"))),;
(stockid1:=odb2:stockid,odb2:stockid:=v,odb2:save(),obrow:refresh(),if(oserver:lError,(msgstop("编号重复或者单据已经使用而不能更改!","停止"),obrow:SEEK(stockid1)),obrow:SEEK(v)) );
);
), ;
) }
Shuming Wang
Shuming,
Really, is not this what I want....
I want to create a object "tget" at bottom of xbrowse, with the same width of it... something like the hscroll of it..
Julio,
do you mean a get like a footer?
Regards,
Detlef
oLbx := TXBrowse():New( oDlgBackup )
oLbx:CreateFromResource( 100 )
oLbx:SetArray( AZIP,.T.)
oLbx:SetRDD(.F.,.T.) //--> Estilo da barra de seleçao.
//-- Estilo --------------------------------//
oLbx:lUpdate:= .T.
oLbx:nMarqueeStyle := MARQSTYLE_HIGHLROW
oLbx:nColDividerStyle := LINESTYLE_LIGHTGRAY
oLbx:nRowDividerStyle := LINESTYLE_LIGHTGRAY
oLbx:nHeaderLines := 01 //-----------> Linhas do Cabecalho.
oLbx:lAllowColSwapping := .F. //-----------> Trocar Colunas
oLbx:lAllowRowSizing := .F. //-----------> Nao move as Linhas
oLbx:lFooter := .T. //-----------> Rodapé
--->>> oLbx:nFooterLines := 01 //-----------> Linhas do Rodapé.<<<---
//-- Colunas -------------------------------//
*1*Caminho
oCol:= oLbx:aCols[1]
oCol:bStrData := { || CAMINHO }
oCol:cHeader := "Caminho"
oCol:nWidth := 390
--->>> oCol:cFooter := cNumeroArquivos <<<---
*2*Tamanho
oCol:= oLbx:aCols[2]
oCol:bStrData := { || TAMANHO }
oCol:cHeader := "Tamanho"
oCol:nWidth := 90
oCol:cFooter := cTamanhoTotal
*3*Status
oCol:= oLbx:aCols[3]
oCol:bStrData := {|| CampoStatus("NOME") }
oCol:cHeader := "Status"
oCol:nWidth := 70
//-- Edição råpida através do browse
oCol:nEditType := EDIT_GET_LISTBOX
oCol:aEditListTxt := if(nRadBackup = 1, aStatusInc, aStatusExt)
oCol:bOnPostEdit := {|o,x| AlterarStatusGrid(x,oLbx:nRolSel()) }
oCol:aEditListBound := if(nRadBackup = 1, {"A","I","O","R"}, {"E","I"})
*4*FromZip
oCol:= oLbx:aCols[4]
oCol:Hide()
//-- Alinhamento ---------------------------//
oLbx:aCols[1]:nDataStrAlign := AL_LEFT
oLbx:aCols[2]:nDataStrAlign := AL_RIGHT
oLbx:aCols[3]:nDataStrAlign := AL_CENTER
//-- Eventos -------------------------------//
oLbx:bLDblClick:= { || AlterarStatusOnClick(oLbx:nRolSel()) }
//-- Atualiza o Rodapé
oLbx:aCols[2]:cFooter := cTamanhoTotalDetlef Hoefner wrote:Julio,
do you mean a get like a footer?
Regards,
Detlef
Julio,
If your browse is on a dialog why not just place the GET there using Workshop?
If the browse is filling a window then I think the best way would be to subclass the browse to add the GET.
Regards,
James
James Bott wrote:Julio,
If your browse is on a dialog why not just place the GET there using Workshop?
If the browse is filling a window then I think the best way would be to subclass the browse to add the GET.
Regards,
James
::oBrwGet := TGet():new( 0, 0,{ | u | If(PCount()==0,::uBrwGet,::uBrwGet:= u ) }, ::oWnd,0,0,"@!",,,,,.F.,,.F.,,.F.,,,,,.F.,.f.,.T.,,.F.,,,,)
::oBrwGet:Move( ::nBottom, ::nLeft, ::nWidth, ::nHeight, .T. )Julio,
I don't understand your code. Is this inside a subclass of the browse? If so, can we see the entire subclass? Better yet, can we see a small example showing the problem?
If it is not in a subclass, then you cannot use a var like ::uBrwGet.
Regards,
James
James Bott wrote:Julio,
I don't understand your code. Is this inside a subclass of the browse? If so, can we see the entire subclass? Better yet, can we see a small example showing the problem?
If it is not in a subclass, then you cannot use a var like ::uBrwGet.
Regards,
James
Julio,
We need to see all the code.
James
Julio,
I still don't understand what you are trying to do. You want to put a GET under the browse that is the same width as the browse? Are you trying to make it look like the last record of the browse? If so, why not just use the last record of the browse?
This code I don't understand:
::oBrwGet := TGet():new( 0, 0,{ | u | If(PCount()==0,::uBrwGet,::uBrwGet:= u ) }, ::oWnd,0,0,"@!",,,,,.F.,,.F.,,.F.,,,,,.F.,.f.,.T.,,.F.,,,,)
First, is this in a subclass of the browse? If so we need to see the subclass.
Why don't you just use xBase syntax like:
@ 1,1 GET oBrwGet var ::uBrwGet of ::oWnd
I don't think you can use an instance variable inside a codeblock. I think you are going to have to make ::uBrwGet a LOCAL.
@ 1,1 GET oBrwGet var uBrwGet of ::oWnd
I think I see what you are trying to do with this line:
::oBrwGet:Move( ::nBottom, ::nLeft, ::nWidth, ::nHeight, .T. )
But this is going to create a GET the same size and in the same place as the browse--I don't think that is what you want. You want to move it below the browse and use the height of the original GET not the height of the browse. You want to use ::oBrwGet:nHeight not ::nHeight.
Also, if you are trying to put both a browse and a GET into the client area of a window then you are going to have to shrink the normal browse by the height of the GET. This is not as simple as it might seem at first.
If you care to explain why you are tryihng to do this, I can perhaps offer an easier solution or an alternate way of accomplishing your goal.
James
James,
Thank you very much for you comprehension... I will try to make a small self example to you.
Please, wait a little time.