It is currently Thu Jan 28, 2021 3:17 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Drag select cells in grid
PostPosted: Fri Dec 13, 2019 3:34 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Dec 29, 2011 5:03 pm
Posts: 594
Hi,

I am trying to create a grid with the CanvasGadget. I can drag select cells as long as the last selected cell is greater than the first selected cell:
Code:
If mX => colX(c) And mX <= colX(c) + *array\colWidths(c)
  If mY => rowY(r) And mY <= rowY(r) + *array\rowHeights(r)
    *array\selEndR = r
    *array\selEndC = c
    If *array\selEndC < *array\selStartC
     
    EndIf
    If *array\selEndR < *array\selStartR
     
    EndIf
    DrawGrid()
    Break
  EndIf
EndIf
How can I adapt this code to work when the user is dragging in the other directions?

I'm not using one of the existing grid controls available on the forums as I want to build my own from scratch to meet my needs.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

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