Page 2 of 4

Re: TextEditGadgetEx edit mode added

Posted: Mon Apr 04, 2011 10:26 pm
by idle
V 0.4b

Added input cursor return key and backspace

Can some one confirm if the marquee on the blue Gradient gadget is flickering on windows?
Start the marquee by right clicking.

Re: TextEditGadgetEx edit mode added

Posted: Tue Apr 05, 2011 9:46 am
by Kwai chang caine
Hello IDLE

Yes i have a little flikering sometime in the right blue panel :(
Nearly all the 1 second

And i have also a little flikering in the left board too
Sometime when i write character in it :(

Re: TextEditGadgetEx edit mode added

Posted: Tue Apr 05, 2011 11:45 am
by eesau
I suppose the new CanvasGadget could be used for this to make it more robust and reduce the flickering.

Re: TextEditGadgetEx edit mode added

Posted: Tue Apr 05, 2011 6:14 pm
by idle
eesau wrote:I suppose the new CanvasGadget could be used for this to make it more robust and reduce the flickering.
Thanks I wasn't sure if the flickering was due to running window in a VM, should be easy enough to fix.

I've been thinking of giving the canvas gadget a try in 4.6b as I've bumped into some irritating behavioral differences between linux and windows
so the codes gotten a bit messy resorting to dirty fixes to facilitate the editor support.

@kcc
Thanks, it will be flickering on every update, I hadn't noticed it before.


The flickering is caused by the image being 32 bit format, so it just needs to be double buffered and copied into a 24 bit image and then set to the image gadget.

Re: TextEditGadgetEx edit mode added

Posted: Tue Apr 05, 2011 7:22 pm
by idle
V 0.41b added dirty arrow keys for cursor navigation, fixed dispaly flicker windows.

It's gotten a little messy, will have to think about doing this properly rather than quick and dirty
I don't know if the key board input will work in other languages, should be ok on windows but I don't know about linux

since the image gadget won't trap input I've added a hidden dummy button on linux to trap input
on windows you just set the focus

Please let me know if there are any other bugs, I'll re factor the code once it's stable.

Re: TextEditGadgetEx edit mode added

Posted: Wed Apr 06, 2011 2:47 pm
by Kwai chang caine
Good news, no flikering on the right side :D

Bad news, i can't enter text in the left side :(
I clic, clic, and clic again, press keyboard, and after a moment the characters appears :shock:
An that, even if i not right clic on the right side

The head sentence move correctly, and if i move the mouse, the head sentence move very very faster, if i move the mouse out of the windows, the sentence move slower, remove inside the windows more faster, etc ...

Re: TextEditGadgetEx edit mode added

Posted: Wed Apr 06, 2011 5:54 pm
by idle
I noticed a problem with the marquee, it's fixed now.
As for the editing if the cursor appears you can type, I can only test it on XP

Re: TextEditGadgetEx resize scaling zoom

Posted: Thu Apr 07, 2011 5:45 am
by idle
v 0.5a

Added Auto gadget resizing, Scaling and Zoom, fixed the marquees

Drawing on windows still needs some attention, the font's look a bit jagged.

v 0.51a

Fixed return bug, trapped non print keys

Re: TextEditGadgetEx resize scaling zoom

Posted: Sat Apr 09, 2011 12:20 am
by idle
v 0.52a

Added AltGtr support for international keyboards

Is still a bug with return key looking!
if you back space a line to a return it will screw up the display.

Please, I would like to get some feedback of how it works on Vista and Win7

Re: TextEditGadgetEx resize scaling zoom

Posted: Sat Apr 09, 2011 12:27 am
by TomS
After clearing the left field and then typing I'll get an IMA at line 465: *this\cfont\name = *this\fonts[0]\name

PB 4.51 Win7 32

Also the marquee is a bit rough. The horizontal one seems like it's stopping every few moments for an instance and the vertical one is rather jumping than floating smoothly.

Re: TextEditGadgetEx resize scaling zoom

Posted: Sat Apr 09, 2011 1:19 am
by idle
TomS wrote:After clearing the left field and then typing I'll get an IMA at line 465: *this\cfont\name = *this\fonts[0]\name

PB 4.51 Win7 32

Also the marquee is a bit rough. The horizontal one seems like it's stopping every few moments for an instance and the vertical one is rather jumping than floating smoothly.
Thanks for that

Fixed the clear bug.

Yes the marquee is a bit rough at the moment, I need to take another look at the drawing routines, I think they're eating to much CPU due to the alpha blending, also since the marquee are running off a window timer in the same thread it's kind of expected to get some jitters especially when both are running together.


something else you could try is to comment out the backbuffer, it's needed on Xp to avoid flickering but maybe not win7
and may be having an adverse effect with aero
line 727

Code: Select all

 ;CompilerIf  #PB_Compiler_OS = #PB_OS_Windows
 ;     StartDrawing(ImageOutput(*this\bufferedImg))
 ;     DrawImage(ImageID(*this\outputImg),0,0)
 ;     StopDrawing()
 ;     SetGadgetState(*this\Gadget,ImageID(*this\bufferedImg)) 
 ;   CompilerElse
      SetGadgetState(*this\Gadget,ImageID(*this\outputimg))
 ;  CompilerEndIf
 ; EndIf

Re: TextEditGadgetEx resize scaling zoom

Posted: Sat Apr 09, 2011 1:44 am
by TomS
Yes it's fixed now.
But after clearing, none of the keys I hit are displayed in the editor (which can be expected, since the gadget doesn't have the focus) except for the last one.

So clear -> "le typing" -> click on editorarea -> "g" is being displayed after a short delay.
I don't think that's intended?

Commenting this part out didn't work on Win7 either. It's flickering as you said.
Maybe you should give the new CanvasGadget() a try.

Re: TextEditGadgetEx resize scaling zoom

Posted: Sat Apr 09, 2011 2:17 am
by idle
Yes I'm going to try the new canvas gadget once I've got the code working with the current setup.
It may at least simplify the event and key input but won't make much difference to the editing.

No idea why g is being displayed, if you didn't press it?
You should be able to click in the gadget again and start typing!

It may help to see if it actually types the right keys before clearing it, it wouldn't surprise me if M$ changed their keyboard handling functions, I just took the path of least resistance implementing the input so is a bit dirty. (the canvas gadget sounds more attractive by the minute)

Re: TextEditGadgetEx resize scaling zoom

Posted: Sat Apr 09, 2011 4:40 am
by idle
Redid the drawing again. right panel was taking ~35ms to render it's now down to ~10 but should really be ~5-7ms
Can't see any difference in the speed on XP but then it's running in a VM and it clearly doesn't like the alpha blending

Re: TextEditGadgetEx resize scaling zoom

Posted: Sun Apr 10, 2011 3:14 am
by idle
v 0.54a

Added scroll down on user input so text stays at the bottom of the gadget
note only happens on input after a return.

Added page navigation
Page up
Page down
Home
End

Changed mouse wheel scroll to scroll by current text height