It is currently Sun Dec 15, 2019 12:09 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 81 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Re: Canvas based Grid gadget
PostPosted: Tue Nov 14, 2017 10:31 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Apr 14, 2011 6:07 pm
Posts: 341
@davido, Andre and KCC the great, you are welcome and thanks for the nice words :D

A new update of this gadget is available now with help file (which is really needed!), i cleaned the code a lot and fixed few glitches on the way ... see first post for the link download

Said


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Wed Nov 22, 2017 4:31 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Dec 15, 2008 11:15 pm
Posts: 142
Location: Nashville, TN
Yes, this is definitely great!! Thanks for this. I'm going to replace the editable grid I have now in my current project with this one as it's much more powerful and has some features already done I need.


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Wed Nov 22, 2017 10:15 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Apr 14, 2011 6:07 pm
Posts: 341
In the past days i had the chance to test more thoroughly this gadget, found few bugs and updated the help file :D
Any bug report is most welcome :)
So a revised version is available on the same github page ... see first post

Said


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Thu Nov 23, 2017 5:09 pm 
Offline
Addict
Addict

Joined: Thu Aug 30, 2007 11:54 pm
Posts: 1165
Location: right here
Great work!
On linux I had to remove the constant at line 5026
Code:
            MessageRequester("Error","Unable to create file ...") ; ,#MB_ICONERROR)
and I had to add a Font at line 3037
Code:
            CompilerCase #PB_OS_Linux
                Protected   Font_T8    = LoadFont(#PB_Any, "Arial",11)


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Thu Nov 23, 2017 5:22 pm 
Offline
Addict
Addict

Joined: Fri Nov 09, 2012 11:04 pm
Posts: 1715
Location: Uttoxeter, UK
@said,
Nice work, thank you for sharing.

@#NULL,
Also works on the Mac. Thanks for the tip.

_________________
DE AA EB


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Thu Nov 23, 2017 10:59 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Apr 14, 2011 6:07 pm
Posts: 341
#NULL wrote:
Great work!
On linux I had to remove the constant at line 5026
Code:
            MessageRequester("Error","Unable to create file ...") ; ,#MB_ICONERROR)
and I had to add a Font at line 3037
Code:
            CompilerCase #PB_OS_Linux
                Protected   Font_T8    = LoadFont(#PB_Any, "Arial",11)


Yes that constant in the test-code is a left over from previous versions, i mostly use windows but the code is made of only PB native code so it should run fine on all supported platforms :)


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Thu Jan 04, 2018 6:28 am 
Offline
New User
New User

Joined: Thu Jan 04, 2018 6:00 am
Posts: 1
Looks good as of Jan 3 2018. Hope development continues.


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Sun Apr 15, 2018 10:58 am 
Offline
New User
New User

Joined: Fri Mar 02, 2018 9:48 am
Posts: 7
Hello ,

thank for the grid is very useful wonderful gadget ..

I have a problem with combobox , after resize the example the combo open is non fased
on grid.

i use purebasic 5.62 on MacOs/windows and the problem is the same ...

is possible correct them ...

thank you

Maurizio


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Mon Apr 16, 2018 9:35 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Apr 14, 2011 6:07 pm
Posts: 341
mauriegio wrote:
Hello ,

thank for the grid is very useful wonderful gadget ..

I have a problem with combobox , after resize the example the combo open is non fased
on grid.

i use purebasic 5.62 on MacOs/windows and the problem is the same ...

is possible correct them ...

thank you

Maurizio


Hello,

You are welcome! Can you please show the steps that lead to described 'bug' ... i am unable to see the issue?!

Said


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Mon Apr 16, 2018 10:09 pm 
Offline
New User
New User

Joined: Fri Mar 02, 2018 9:48 am
Posts: 7
Thanks,

in the exampe if you open the windows to the max , combo box not fased when click on the arrow...

if you resize is seems ok ... but if go max ...problem

Maurizio


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Tue Apr 17, 2018 3:39 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Apr 14, 2011 6:07 pm
Posts: 341
Sorry Maurizio, i am still unable to reproduce!

Even installed PB 5.62 for this, still cant reproduce ... Tested on Windows 10 (both PB 32/64) with 200 DPI screen as well

Is anyone else facing this issue? Thanks for reporting


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Sat May 19, 2018 9:15 am 
Offline
Addict
Addict

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 4466
Location: Germany
Hi said,

I just needed your code in a small project, but after implemented a 'fixed' size, I found some confusing things:
Code:
#ColWidth = 40
#RowHeight = 20

#Cols = 20
#Rows = 10

Enumeration
  #Grid1
  #Grid2
EndEnumeration
 
Define.i i

IncludeFile "MyGrid.pbi"

OpenWindow(0, 0, 0, 860, 460, "Test", #PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)

MyGrid::New(0, #Grid1, 10, 10, (#Cols + 1) * #ColWidth, (#Rows + 1) * #RowHeight, #Rows, #Cols, #False, #False, #False)
MyGrid::SetColWidth(#Grid1, MyGrid::#RC_Any, #ColWidth)
MyGrid::SetRowHeight(#Grid1, MyGrid::#RC_Any, #RowHeight)
MyGrid::Redraw(#Grid1)

MyGrid::New(0, #Grid2, 10, 240, (#Cols + 1) * (#ColWidth - 1), (#Rows + 1) * (#RowHeight - 1), #Rows, #Cols, #False, #False, #False)
MyGrid::SetColWidth(#Grid2, MyGrid::#RC_Any, #ColWidth)
MyGrid::SetRowHeight(#Grid2, MyGrid::#RC_Any, #RowHeight)
MyGrid::Redraw(#Grid2)

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow

If I set the size calculation to the 'right' values (#Grid1) then it looks to big.
The 'fault' growth when I increase the rows for example.

If I fix it by using a size which is one pixel smaller (#Grid2) (maybe the border pixel),
then it looks good, but...
when I go to the lowest row, via key down, it 'jumps' one row.
Same happens to the end of the cols.

Is this 'normal' behaviour or is there a small bug inside?

Is it an inconsistent usage of ColWidth and RowHeight?
In one case with border in one without.

I use the latest version from your link in post 1.
PB 5.62 x86 on Win10 x64

P.S.: one thing I was struggling about: everywhere it is width, height
In your New it is width, height, ROWS, COLS. I first used width, height, COLS, ROWS, which was wrong :wink:

Bernd


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Sat May 19, 2018 3:41 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Apr 14, 2011 6:07 pm
Posts: 341
Hi Bernd,

You have guessed it right, there is always 1 pixel for the border (be it horizontal or vertical)

I believe, this little jump at the end of rows/cols is due to 1 pixel missing, here is how i would use this grid with a fixed size (your example re-worked):
Code:
#ColWidth = 40
#RowHeight = 20

#Cols = 20
#Rows = 10

Enumeration
  #Grid1
  #Grid2
EndEnumeration
 
Define.i i

IncludeFile "MyGrid.pbi"

OpenWindow(0, 0, 0, 860, 460, "Test", #PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)

; MyGrid::New(0, #Grid1, 10, 10, (#Cols + 1) * #ColWidth, (#Rows + 1) * #RowHeight, #Rows, #Cols, #False, #False, #False)
;
; For i = 0 To #Cols
;   MyGrid::SetColWidth(#Grid1, i, #ColWidth)
; Next i
;
; For i = 0 To #Rows
;   MyGrid::SetRowHeight(#Grid1, i, #RowHeight)
; Next i
;
; MyGrid::Redraw(#Grid1)

; neededWidth =

neededWidth.i = (#ColWidth * (#Cols + 1) ) - #Cols
neededHeight.i = (#RowHeight * (#Rows + 1) ) - #Rows


MyGrid::New(0, #Grid2, 10, 240, neededWidth, neededHeight, #Rows, #Cols, #False, #False, #False)

For i = 0 To #Cols
  MyGrid::SetColWidth(#Grid2, i, #ColWidth)
Next i

For i = 0 To #Rows
  MyGrid::SetRowHeight(#Grid2, i, #RowHeight)
Next i

MyGrid::Redraw(#Grid2)


Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow


I hope this helps :D

Said


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Sat May 19, 2018 4:14 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Dec 10, 2010 6:31 pm
Posts: 153
whether this gadget support right-to-left?
If yes, how?

_________________
Sorry for my bad English.

Amitris


Top
 Profile  
Reply with quote  
 Post subject: Re: Canvas based Grid gadget
PostPosted: Mon Jul 09, 2018 9:07 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jul 03, 2003 6:53 pm
Posts: 1287
Location: England
@said

This is excellent!
Thank you very much for sharing :D


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 13 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