Page 1 of 1

Cutting with ContextMenu 'eats buffer

Posted: Mon Feb 22, 2010 7:01 am
by Markus Walter
Hi Roger,

in October 2009 i asked in old webboard about a problem with using Cut from Contextmenu of a dcget:

--- snip ---
using "Cut" from the contextmenu of a dcget "eats" the cutted chars from the get. This menas that after cutting you can insert less characters.
exp. have a dcget with length 30 from a db-field. Cut 10 characters over Contextmenu. After that you can only write 20 characters to these get. Using Strg-X doesn't show this effect.

Sample:

Code: Select all

#include "dcdialog.ch"
#include "appevent.ch"

function Appsys()
return NIL


procedure main()
local getlist := {}, getoptions := {}, lRet
local cVar1 := space(30), cVar2 := padr("Cut this to see", 30)


@3, 3 dcget cVar1
@4, 3 dcget cVar2

DCGETOPTIONS TITLE "Test"

DCREAD GUI TO lRet OPTIONS getoptions ADDBUTTONS FIT

RETURN
Can you confirm this? Or is that a problem with german xbase/windows? There are some other problems with pasting in "german" version gets (exp. num. get with picture).

--- endsnip ---

Can you please have a look?

Re: Cutting with ContextMenu 'eats buffer

Posted: Mon Feb 22, 2010 8:46 am
by rdonnay
Markus -

I tested it with Xbase++ 331 and 355 and both work fine for me.
Maybe, some other eXpress++ users can run your sample and confirm that it may be a problem with the German version.

Roger

Re: Cutting with ContextMenu 'eats buffer

Posted: Tue Aug 10, 2010 1:34 am
by Markus Walter
Hi Roger,

i have to come with this again, because some of my customers are still complaining about this...

Here is a exact description how to get the effect (with the sample above):
1. Mark the text "Cut this to see" with the mouse (or tastatur)
2. Right-Click and choose "Cut" from the context menu
3. click to the first get and back to the second get (IMPORTANT!!!), you doesn't have to do anything in the first GET
4. Type "1234567890123456..." in the second get and the length of the buffer will be: Original - Len(cutted-text)

The problem doesn't exist with using Strg-X instead of ContextMenu.

Can you have a look, please?

Re: Cutting with ContextMenu 'eats buffer

Posted: Tue Aug 17, 2010 12:18 am
by Markus Walter
Hi Roger,

can you please look for this problem (with exact the 4 steps i wrote in my last message). An other express-user has the same effect and found a workaround: Using a Picture like "@N" for each DCGET...

Re: Cutting with ContextMenu 'eats buffer

Posted: Wed Aug 18, 2010 10:44 am
by rdonnay
Ok, I think I can reproduce a problem, but I don't get an error.

If I cut the text, then move to the 1st get and back to the 2nd get, the buffer size is reduced to the length of the cut text.
I'll see what I can do.

Re: Cutting with ContextMenu 'eats buffer

Posted: Wed Aug 18, 2010 4:54 pm
by rdonnay
Markus -

Make the below change to \exp19\source\dclipx\_DCXBPGT.PRG and rebuild DCLIPX.DLL by running BUILD19_SL1.BAT.
Let me know if this works for you.
It works for me.

Code: Select all

METHOD DC_XbpGet:rbUp( mp1, mp2 )

IF ::isCalc
  ::setParent():rbUp( mp1, mp2 )
ELSE
  ::Get:Buffer := ::EditBuffer()
  ::xbpSLE:rbUp( mp1, mp2 )

  IF Len(::get:Buffer) < ::bufferLength                         <<<<<<<<<<<<<<
    ::get:Buffer := Pad(::get:Buffer,::bufferLength)        <<<<<<<<<<<<<<
    ::xbpSle:setData(::get:Buffer)                               <<<<<<<<<<<<<<
  ENDIF                                                                  <<<<<<<<<<<<<<

ENDIF

RETURN self

Re: Cutting with ContextMenu 'eats buffer

Posted: Thu Aug 19, 2010 12:16 am
by Markus Walter
Hello Roger,

okay, this works in all my tests. Thanks.