Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Applying onMouseDragged to GuiTextListEntry? (https://forums.graalonline.com/forums/showthread.php?t=75049)

HolySheepy 07-01-2007 10:20 PM

Applying onMouseDragged to GuiTextListEntry?
 
Hi

well i tried
function DragTestWindowList.rows[0].icon.onMouseDragged(keymodifier,mousescreenx,mous escreeny)

but it gives that error:

error: unexpected symbol [ at line 35: function DragTestWindowList.rows[0].icon.onMouseDragged(keymodifier,mousescreenx,mous escreeny)

Chompy 07-01-2007 10:42 PM

Uhm
A function like that isn't valid :O

Try use thiso.catchevent() on the rows, then use onMouseDragged()
for example:

thiso.cathevent(this, "onMouseDragged", "onRowDragged");

But why would you want to drag rows?

HolySheepy 07-01-2007 10:59 PM

i tried that, didnt really work

well i want to drag the icons of the rows :D

Chompy 07-01-2007 11:01 PM

hmm, post some of the code used?

And I don't know if the rows support dragging :O

HolySheepy 07-02-2007 10:21 AM

quick and dirty:

PHP Code:

//#CLIENTSIDE
function onPlayerChats()
  {
  if( 
player.chat == "/dragtest" )
    {
    
DragTestWindow.destroy();
    new 
GuiWindowCtrlDragTestWindow )
      {
      
100;
      
width 100;
      
100;
      
height 100;
      
profile GuiBlueWindowProfile;
      new 
GuiTextListCtrlDragTestWindowList )
        {
        
profile GuiBlueTextListProfile;
        
10;
        
30;
        
seticonsize(32,32);
        
width 80;
        
height 80;
        
withaddRow0"test" ) )
          {
          
icon.drawImage(0,0,"block.png");
          
withicon )
            {
            
thiso.catcheventthis"onMouseDragged""onMDrag" );
            }
          }
        }
      }
    }
  }
 
function 
onMDrag(keymodifier,mousescreenx,mousescreeny)
  {
  
player.chat "drag";
  } 

i tried the catchevent within the row didnt work
i tried the catchevent within the guitextlist, works

i guess i have to use it in guitextlist ctrl and check mousex and y to get the row x.x

Chompy 07-02-2007 03:26 PM

Yep, I don't think you can drag rows/row icons :(

HolySheepy 07-02-2007 03:28 PM

yeah i just checked for x/y, works now

zokemon 07-09-2007 04:19 PM

icon is a TDrawingPanel which does not inherit GuiControl variables/functions same with GuiTextListEntry (they both just inherit TGraalVar). Your best bet is just just put it on the GuiTextListCtrl it self and just check the selected row in the control.


All times are GMT +2. The time now is 02:05 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.