It is currently Wed Jan 29, 2020 1:09 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 86 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6
Author Message
 Post subject: Re: Canvas based Grid gadget
PostPosted: Wed Apr 03, 2019 5:15 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Jun 23, 2010 5:13 pm
Posts: 206
Very nice gadget and useful.
Adding few hundred records to grid with sql select loop is may seem no problem but 6K records take 20 seconds with elapsedmilliseconds and disabled debugger on intel i5 8GB RAM. 27MB RAM and 50% CPU is used.

Would be very thankful for solution.


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Wed Apr 03, 2019 6:40 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 3187
Location: Boston, MA
Rich gadgets are not intended to populate entire data set. Change your code to fill only 50 or whatever records and use scrollbars to update.

_________________
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Thu Apr 04, 2019 2:38 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Jun 23, 2010 5:13 pm
Posts: 206
Thank You very much.
I got that part but scrolling is not working.

I have digged deeper and found that "shift", "ctrl" and "ctrl"+"shift" handled but not #PB_Canvas_Shift and Srolling

Strange part that MyGrid example is working.


Last edited by LiK137 on Thu Apr 04, 2019 9:42 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Thu Apr 04, 2019 9:42 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Apr 14, 2011 6:07 pm
Posts: 342
LiK137 wrote:
Very nice gadget and useful.
Adding few hundred records to grid with sql select loop is may seem no problem but 6K records take 20 seconds with elapsedmilliseconds and disabled debugger on intel i5 8GB RAM. 27MB RAM and 50% CPU is used.

Would be very thankful for solution.

Hi,

To load big number of rows, i would use it this way (not sure if you are not using it already though):
Code:
MyGrid::NoRedraw(Gadget)
.... load huge data here ...
MyGrid::Redraw(Gadget)

What skywalk has mentioned is certainly very valid, however the events received by the scrollbars are bound to an internal procedures via BindGadgetEvent() that synchronize the drawing _SynchronizeGridCols() and _SynchronizeGridRows() ... It wont be easy to change those routines so you can intercept scrollbars events! At least i wont do it myself! Not sure if more recent versions of PB offer more flexibility regrading scrollbars events, i am no longer using PB these days



Said


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Thu Apr 04, 2019 9:48 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Jun 23, 2010 5:13 pm
Posts: 206
Thank You very much.

I agree with that big data should be handled by partial load with scrolling.

And I see that scrolling is handled and index is changing based on direction of scrolling.
Arrow keys with any combination (Ctrl and/or Shift) events are handled
MoveLeft...MoveDown is Handled but grid is not changing/refreshing.

Finaly, Redraw(Gadget) was just resizing while NoRedraw(Gadget) was changing flag permanently.
That is why grid was not refresing. Just Copied NoRedraw as AutoRedraw with flag set #True.

ThanQ very much again for replies.


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Tue Dec 24, 2019 6:03 am 
Offline
User
User
User avatar

Joined: Mon Apr 23, 2007 4:50 am
Posts: 35
Location: Nabiac NSW Australia
@said

Thank you very much for your Grid gadget, I have used it successfully in one project already in combination with Google SQL Cloud.

I was wondering if it was possible to have something like

EditCell(Gadget.i, Row, Col, SetCellFocus = #True)

where after calling the cell is ready for immediate editing, without having to click the mouse to start the editing process.

P.S. Seasons Greetings ! :)

_________________
Singo
Win10, Win7, Debian x86 & OSX ~ PB 5.70 LTS
Minimbah NSW Australia


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Tue Dec 24, 2019 12:18 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 2170
Location: Germany
Is like Excel, only not the F2 key but the Enter key.

Had once added the F2 key for editing

_________________
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Thu Dec 26, 2019 7:05 am 
Offline
User
User
User avatar

Joined: Mon Apr 23, 2007 4:50 am
Posts: 35
Location: Nabiac NSW Australia
Thank you and yes AFTER clicking an editable cell you can then use the Return key.

But I want my program to do this NOT the user.

I would like my program to start and immediately be in an editable cell without any user clicking the mouse or pressing any keys.

Is this possible ?

Thank you

_________________
Singo
Win10, Win7, Debian x86 & OSX ~ PB 5.70 LTS
Minimbah NSW Australia


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Thu Dec 26, 2019 9:52 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Apr 14, 2011 6:07 pm
Posts: 342
singo wrote:

I would like my program to start and immediately be in an editable cell without any user clicking the mouse or pressing any keys.



Hi Singo,

First, glad to hear that my work was helpful to you, you are welcome ... and Seasons Greetings to everyone
I see the great mk-soft is trying to help as always!

The default editing mode is: when in a cell, you start typing and you exit with any keys ... you overwrite existing content
The other mode is you hit enter in a cell and then the caret is placed at the end of current cell-text, so any new typed text is placed at the end ... you are appending new text to existing one

Back to your question, i believe this is the default mode, am i missing something here?

Said


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Thu Dec 26, 2019 1:15 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 2170
Location: Germany
I think he wants to initialize the edit mode from a cell via the program, but this is not a standard.

_________________
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Fri Dec 27, 2019 8:48 am 
Offline
User
User
User avatar

Joined: Mon Apr 23, 2007 4:50 am
Posts: 35
Location: Nabiac NSW Australia
mk-soft wrote:
I think he wants to initialize the edit mode from a cell via the program, but this is not a standard.


Yes, exactly, I'm sorry if I wasn't clear but that is what I want to do.

I want to use the grid for data entry and I don't want the user to have to click every time they want to make an entry.

_________________
Singo
Win10, Win7, Debian x86 & OSX ~ PB 5.70 LTS
Minimbah NSW Australia


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 86 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye