New get at bottom of xBrowse!? ( Solved! )

New get at bottom of xBrowse!? ( Solved! )

Postby JC » Mon Dec 22, 2008 1:37 pm

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!!
Last edited by JC on Thu Jan 08, 2009 11:42 am, edited 1 time in total.
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Postby JC » Mon Dec 22, 2008 5:24 pm

Friends,

I'd like to use this object in the creation of xBrowse.
I tried with this code, but this returns to me a error
The code:
Code: Select all  Expand view
   ::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. )

The error:
Code: Select all  Expand view
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)
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Postby ShumingWang » Tue Dec 23, 2008 12:57 am

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
ShumingWang
 
Posts: 460
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Postby JC » Tue Dec 23, 2008 6:46 pm

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..
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Postby Detlef Hoefner » Tue Dec 23, 2008 11:03 pm

Julio,

do you mean a get like a footer?

Regards,
Detlef
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Postby sambomb » Wed Dec 24, 2008 10:44 am

Vê se é isso que você quer?(demarcado com as setas, porque não funciona BBCode dentro da tag "code"

Code: Select all  Expand view
   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()) }



E para atualizar o rodapé:
Code: Select all  Expand view
   
   //-- Atualiza o Rodapé
   oLbx:aCols[2]:cFooter := cTamanhoTotal
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Postby JC » Wed Dec 24, 2008 11:50 am

Detlef Hoefner wrote:Julio,

do you mean a get like a footer?

Regards,
Detlef


Detlef,

Exactly!!
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Postby James Bott » Wed Dec 24, 2008 8:26 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby JC » Fri Dec 26, 2008 2:19 pm

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


Yes James,

This is the second type! But, allways I get error with my source code...

I tried this code:
Code: Select all  Expand view
::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. )
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Postby James Bott » Fri Dec 26, 2008 4:34 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby JC » Fri Dec 26, 2008 7:41 pm

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


James,

I tried to use like button of get with action clausule... Creating a class var ::oBrwBet for receiving the instance of Tget class... but, not works!
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Postby James Bott » Fri Dec 26, 2008 11:00 pm

Julio,

We need to see all the code.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby James Bott » Sat Dec 27, 2008 4:40 am

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: New get at bottom of xBrowse!?

Postby JC » Tue Dec 30, 2008 4:28 pm

James,

Thank you very much for you comprehension... I will try to make a small self example to you.
Please, wait a little time.
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Re: New get at bottom of xBrowse!?

Postby JC » Tue Dec 30, 2008 5:38 pm

Explanation:

When the user clicks the header of any column, the xbrowse should open a get at footer in the same, to perform an incremental search with that column

Like this image bellow, but I will work on "look & feel"!
Image
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 89 guests