From: SzGábor on 16 Mar 2010 14:51 Pleas help Me. I asked for many times but not received answer. My problem in bBrowse editing. I want to edit the numeric field the next way: I put the appropriate place in the field spec @Z 999 999 999 999 If I want press the next value: 165 432 I want the key type order appearing: The Key type appearing now but I want the next appearing . 1 1 1 2. 16 16 3. 165 165 4. 165 4 1 654 5. 165 43 16 543 6. 165 435 165 435 Hear is my editcell method What must I do ???????????????? My Hungarian colleague said that the solution is in the CellEdit of bBrowser With the next code /*oCellEditEvent:EditControl:Setstyle(ES_RIGHT, TRUE) */ But it is not work for me. If someone help me solve my problem, I will thank it very much. METHOD CellEdit(oCellEditEvent) CLASS bdatabrowser // check the edit mode LOCAL ok:=.t. LOCAL c_biz:="" LOCAL n_szam_tor LOCAL oColumn LOCAL nCol *********Figyelje hogy történt-e rögzítés l_van_rogzités:=.t. *********Figyelje hogy történt-e rögzítés * oCellEditEvent:EditControl:Setstyle(ES_RIGHT, TRUE) n_szam_tor:=0 IF oCellEditEvent:EditMode=BEDIT_CREATE //1 // This is used for pre-validation logic. */ oColumn := oCellEditEvent:CONTROL:GetOpenColumn(oCellEditEvent:EditCell:Column) * oCellEditEvent:CONTROL:Setstyle(ES_NUMBER,TRUE) * Ilyen értékek lehetnek *ES_RIGHT *WS_EX_RIGHT *ES_AUTOHSCROLL *ES_NUMBER * oCellEditEvent:CONTROL:Setstyle(ES_RIGHT,TRUE) // not work IF oColumn:FieldSym=#OSEG *oColumn:FieldSpec:Picture:='999 999 999' * oColumn:FieldSpec:Picture:= "###,###,###" *oColumn:Alignment := BALIGN_RIGHT * oColumn:SetStyle(ES_RIGHT,TRUE) // right alignment ENDIF IF oColumn:FieldSym=#AFA .AND. SELF:oDCbBrowser:Server:mn == " " ErrorBox{SELF:owner, "Mivel érték MN üres ezért az áfa mezõbe nem írhat !"+_CHR(7) }:Show() oCellEditEvent:CONTROL:SetFocus() RETURN FALSE ENDIF //............... ELSEIF oCellEditEvent:EditMode=BEDIT_INIT * SELF:owner:Setstyle(ES_RIGHT , TRUE) *oCellEditEvent:EditControl:Setstyle(ES_RIGHT,TRUE) a_szam[_eredeti]:=oCellEditEvent:EditControl:TextValue // This is used for field validation if we need it. ELSEIF oCellEditEvent:EditMode = BEDIT_HIDE // 6 // This is used for hide logic. ELSEIF oCellEditEvent:EditMode = BEDIT_CANCEL // 4 // This is used for cancellation logic. ELSEIF oCellEditEvent:EditMode=BEDIT_END // This is used for post-validation logic. oColumn := oCellEditEvent:CONTROL:GetOpenColumn(oCellEditEvent:EditCell:Column) a_szam[_javitott]:=oCellEditEvent:EditControl:TextValue DO CASE CASE oColumn:FieldSym=#AK // nézze meg, hogy helyes áfakódot irt-e be, ha igen, akkor AK_SZAMOLO[_afa_ak]:=a_szam[_javitott] //1-es poz hogy számol 2- es adókód 3-as afa % 4- AK_SZAMOLO[_afa_OSEG]:=oCellEditEvent:CONTROL:GetOpenColumn(FieldPos("OSEG")):value AK_SZAMOLO[_afa_afa]:=oCellEditEvent:CONTROL:GetOpenColumn(FieldPos("AFA")):value ***************Menjen be a törzsbe ellenõrízzen,és vegye fel a számolás eredményeit ok:=SELF:torzsnez("AK",a_szam[_javitott] ) ***************Menjen be a törzsbe ellenõrízzen,és vegye fel a számolás eredményeit RETURN(ok) CASE oColumn:FieldSym=#BIZ //.or. oColumn:FieldSym=#AFA c_biz:=oCellEditEvent:EditControl:TextValue IF oDCbBrowser:CurrentRecNo = SELF:oDCbBrowser:Server:RECCOUNT .AND.; Len(AllTrim(SELF:oDCbBrowser:Server:PB))=0 SELF:oDCbBrowser:Server:PB:=c_elozo_pb ENDIF //.............. ENDCASE *Az utolsó rekordnál nézze meg hogy a biz.szám üres-e ha igen, akkor ne engedjen több rekordot felvenni IF oDCbBrowser:CurrentRecNo = SELF:oDCbBrowser:Server:RECCOUNT IF Len(c_biz)=0 .AND. oCellEditEvent:EditCell:Column=1 .OR.; Len(AllTrim( SELF:oDCbBrowser:Server:BIZ ))=0 oDCbBrowser:AutoAppend := FALSE ELSE oDCbBrowser:AutoAppend := TRUE ENDIF ENDIF *Az utolsó rekordnál nézze meg hogy a biz.szám üres-e ha igen, akkor ne engedjen több rekordot felvenni*/ oCellEditEvent:Control:__Update() ELSEIF oCellEditEvent:EditMode=BEDIT_COMMIT // commit implement // -> This is expected by some servers (BufferedServer !?) oColumn := oCellEditEvent:CONTROL:GetOpenColumn(oCellEditEvent:EditCell:Column) nCol:=oDCbBrowser:CurrentColumn ELSEIF oCellEditEvent:EditMode=BEDIT_SHOW //5 // This is used for show logic. * oCellEditEvent:Control:__Update() ENDIF RETURN TRUE Gábor Szõke
From: Geoff Schaller on 16 Mar 2010 17:43 SG, You need to replace the default edit SLE that bbrowser uses with your that has the field spec with the picture applied. So in fact this has nothing to do with CellEdit and you're messing with fire here. Try this: can you place an SLE on a window and make it behave the way you want with a fieldspec? If the answer is yes then you must create and supply the same SLE to the bbrowser and then I suspect it will be fine. bBrowser docs show you how to do this. Geoff "SzG�bor" <szgabor1961(a)gmail.com> wrote in message news:ffe73bad-97b0-4ab0-9bef-5d93c8d740da(a)p3g2000pra.googlegroups.com: > Pleas help Me. > > I asked for many times but not received answer. > My problem in bBrowse editing. > I want to edit the numeric field the next way: > > I put the appropriate place in the field spec @Z 999 999 999 999 > > If I want press the next value: 165 432 > > I want the key type order appearing: > The Key type appearing now but I want the > next > appearing > . > 1 1 1 > 2. 16 16 > 3. 165 165 > 4. 165 4 1 654 > 5. 165 43 16 543 > 6. 165 435 165 435 > > Hear is my editcell method > What must I do ???????????????? > > My Hungarian colleague said that the solution is in the CellEdit of > bBrowser > With the next code > /*oCellEditEvent:EditControl:Setstyle(ES_RIGHT, TRUE) */ > But it is not work for me. > > If someone help me solve my problem, I will thank it very much. > > METHOD CellEdit(oCellEditEvent) CLASS bdatabrowser > // check the edit mode > LOCAL ok:=.t. > LOCAL c_biz:="" > LOCAL n_szam_tor > LOCAL oColumn > LOCAL nCol > *********Figyelje hogy t�rt�nt-e r�gz�t�s > l_van_rogzit�s:=.t. > *********Figyelje hogy t�rt�nt-e r�gz�t�s > > * oCellEditEvent:EditControl:Setstyle(ES_RIGHT, TRUE) > n_szam_tor:=0 > IF oCellEditEvent:EditMode=BEDIT_CREATE //1 > // This is used for pre-validation logic. > */ > oColumn := > oCellEditEvent:CONTROL:GetOpenColumn(oCellEditEvent:EditCell:Column) > > * oCellEditEvent:CONTROL:Setstyle(ES_NUMBER,TRUE) > > * Ilyen �rt�kek lehetnek > *ES_RIGHT > *WS_EX_RIGHT > *ES_AUTOHSCROLL > *ES_NUMBER > > > > * oCellEditEvent:CONTROL:Setstyle(ES_RIGHT,TRUE) // not work > > > IF oColumn:FieldSym=#OSEG > *oColumn:FieldSpec:Picture:='999 999 999' > * oColumn:FieldSpec:Picture:= "###,###,###" > *oColumn:Alignment := BALIGN_RIGHT > * oColumn:SetStyle(ES_RIGHT,TRUE) // right alignment > > > ENDIF > > > > > IF oColumn:FieldSym=#AFA .AND. SELF:oDCbBrowser:Server:mn == " " > ErrorBox{SELF:owner, "Mivel �rt�k MN �res ez�rt az �fa mez�be nem > �rhat !"+_CHR(7) }:Show() > > oCellEditEvent:CONTROL:SetFocus() > > RETURN FALSE > ENDIF > > //............... > > ELSEIF oCellEditEvent:EditMode=BEDIT_INIT > > > * SELF:owner:Setstyle(ES_RIGHT , TRUE) > *oCellEditEvent:EditControl:Setstyle(ES_RIGHT,TRUE) > > a_szam[_eredeti]:=oCellEditEvent:EditControl:TextValue > > > // This is used for field validation if we need it. > > ELSEIF oCellEditEvent:EditMode = BEDIT_HIDE // 6 > // This is used for hide logic. > > ELSEIF oCellEditEvent:EditMode = BEDIT_CANCEL // 4 > // This is used for cancellation logic. > > ELSEIF oCellEditEvent:EditMode=BEDIT_END > // This is used for post-validation logic. > > oColumn := > oCellEditEvent:CONTROL:GetOpenColumn(oCellEditEvent:EditCell:Column) > > a_szam[_javitott]:=oCellEditEvent:EditControl:TextValue > > DO CASE > > CASE oColumn:FieldSym=#AK // n�zze meg, hogy helyes �fak�dot irt-e > be, ha igen, akkor > > AK_SZAMOLO[_afa_ak]:=a_szam[_javitott] //1-es poz hogy sz�mol 2- > es ad�k�d 3-as afa % 4- > > AK_SZAMOLO[_afa_OSEG]:=oCellEditEvent:CONTROL:GetOpenColumn(FieldPos("OSEG")):value > > AK_SZAMOLO[_afa_afa]:=oCellEditEvent:CONTROL:GetOpenColumn(FieldPos("AFA")):value > ***************Menjen be a t�rzsbe ellen�r�zzen,�s vegye fel a > sz�mol�s eredm�nyeit > ok:=SELF:torzsnez("AK",a_szam[_javitott] ) > ***************Menjen be a t�rzsbe ellen�r�zzen,�s vegye fel a > sz�mol�s eredm�nyeit > > RETURN(ok) > > CASE oColumn:FieldSym=#BIZ //.or. oColumn:FieldSym=#AFA > c_biz:=oCellEditEvent:EditControl:TextValue > > IF oDCbBrowser:CurrentRecNo = > SELF:oDCbBrowser:Server:RECCOUNT .AND.; > Len(AllTrim(SELF:oDCbBrowser:Server:PB))=0 > SELF:oDCbBrowser:Server:PB:=c_elozo_pb > ENDIF > > //.............. > > ENDCASE > > *Az utols� rekordn�l n�zze meg hogy a biz.sz�m �res-e ha igen, akkor > ne engedjen t�bb rekordot felvenni > IF oDCbBrowser:CurrentRecNo = SELF:oDCbBrowser:Server:RECCOUNT > IF Len(c_biz)=0 .AND. oCellEditEvent:EditCell:Column=1 .OR.; > Len(AllTrim( SELF:oDCbBrowser:Server:BIZ ))=0 > oDCbBrowser:AutoAppend := FALSE > ELSE > oDCbBrowser:AutoAppend := TRUE > ENDIF > ENDIF > *Az utols� rekordn�l n�zze meg hogy a biz.sz�m �res-e ha igen, akkor > ne engedjen t�bb rekordot felvenni*/ > > oCellEditEvent:Control:__Update() > > ELSEIF oCellEditEvent:EditMode=BEDIT_COMMIT > > // commit implement > > // -> This is expected by some servers (BufferedServer !?) > > oColumn := > oCellEditEvent:CONTROL:GetOpenColumn(oCellEditEvent:EditCell:Column) > nCol:=oDCbBrowser:CurrentColumn > > ELSEIF oCellEditEvent:EditMode=BEDIT_SHOW //5 > // This is used for show logic. > > * oCellEditEvent:Control:__Update() > > ENDIF > RETURN TRUE > > G�bor Sz�ke
|
Pages: 1 Prev: CDX Index Tag creation not working Next: In bBrowse the numeric keystruck appearing |