Cutting with ContextMenu 'eats buffer

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Markus Walter
Posts: 54
Joined: Thu Jan 28, 2010 12:49 am
Location: Germany

Cutting with ContextMenu 'eats buffer

#1 Post 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?
-----------------
Greetings
Markus Walter

User avatar
rdonnay
Site Admin
Posts: 4733
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Cutting with ContextMenu 'eats buffer

#2 Post 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
The eXpress train is coming - and it has more cars.

User avatar
Markus Walter
Posts: 54
Joined: Thu Jan 28, 2010 12:49 am
Location: Germany

Re: Cutting with ContextMenu 'eats buffer

#3 Post 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?
-----------------
Greetings
Markus Walter

User avatar
Markus Walter
Posts: 54
Joined: Thu Jan 28, 2010 12:49 am
Location: Germany

Re: Cutting with ContextMenu 'eats buffer

#4 Post 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...
-----------------
Greetings
Markus Walter

User avatar
rdonnay
Site Admin
Posts: 4733
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Cutting with ContextMenu 'eats buffer

#5 Post 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.
The eXpress train is coming - and it has more cars.

User avatar
rdonnay
Site Admin
Posts: 4733
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Cutting with ContextMenu 'eats buffer

#6 Post 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
The eXpress train is coming - and it has more cars.

User avatar
Markus Walter
Posts: 54
Joined: Thu Jan 28, 2010 12:49 am
Location: Germany

Re: Cutting with ContextMenu 'eats buffer

#7 Post by Markus Walter »

Hello Roger,

okay, this works in all my tests. Thanks.
-----------------
Greetings
Markus Walter

Post Reply