deciphering message box

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

deciphering message box

Post by cusingerBUSCw5N » Tue Oct 10, 2017 10:35 pm

I am getting a message box that I can't decipher. It's connected to a datagrid, but even when I remove the formatting for the datagrid, the message box appears. Here is the message:

241,2417,1,_CalculateFormattedHeight
353,0,0,button id 1005 of group id 1004 of card id 1002 of stack "C:/Program Files (x86)/RunRev/LiveCode Indy 8.1.5/Toolset/palettes/revdatagridlibrary.rev"
573,1635,1,_CalculateFormattedHeight
253,1635,1
253,1635,1

it says at the top: selectedOject: group "Datagrid_deals3". Here is the datagrid script:

Code: Select all

-- This script defines the behavior of your data grid's custom template. This behavior
-- DATAGRID_DEALS3

on FillInData pDataArray
    -- This message is sent when the Data Grid needs to populate
    -- this template with the data from a record. pDataArray is an
    -- an array containing the records data.
    -- You do not need to resize any of your template's controls in
    -- this message. All resizing should be handled in resizeControl.
    
    -- Example:
   //  set the text of field "Label" of me to pDataArray["label 1"]
   set the text of field "business" of me to pDataArray["business"]
   set the text of field "website" of me to pDataArray["website"]
   set the text of field "deal" of me to pDataArray["deal"]
   set the text of field "expires" of me to "Expires: "&pDataArray["expires"]

         set the filename of image "imagedeal" of me to pDataArray["imagedeal2"]
         set the text of field "width" of me to pDataArray["width2"]

         set the text of field "height" of me to pDataArray["height2"]    

end FillInData


on LayoutControl pControlRect
    local theFieldRect
    
    -- This message is sent when you should layout your template's controls.
    -- This is where you resize the 'Background' graphic, resize fields and 
    -- position objects.
    -- For fixed height data grid forms you can use items 1 through 4 of pControlRect as
    -- boundaries for laying out your controls.
    -- For variable height data grid forms you can use items 1 through 3 of pControlRect as
    -- boundaries, expanding the height of your control as needed.
        
    -- Example:

    put the rect of field "Label" of me into theFieldRect
    put item 3 of pControlRect - 5 into item 3 of theFieldRect
    set the rect of field "Label" of me to theFieldRecT

     set the vis of field "label" of me to false
        put the rect of me into theMasterRect
         
             put the rect of field "deal" of me into tdeal

     put item 1 of theMasterRect into item 1 of tdeal
     put item 2 of theMasterRect into item 2 of tdeal
     put (item 3 of themasterRect - item 1 of themasterRect)*.60 into tright
     put tright into item 3 of tdeal
     set the height of field "deal" of me to the formattedheight of field "deal" of me  
     put (item 2 of tdeal  + the height of field "deal" of me) into item 4 of tdeal
set the rect of field "deal" of me to tdeal


    put the rect of image "imagedeal" of me into timage
    put field "width" of me into twidth
  
    set the height of field "expires" of me to the formattedheight of field "expires" of me
       
       
         put the rect of field "business" of me  into tinterest
    put item 1 of theMasterRect  into item 1 of tinterest
    put item 4 of tdeal into item 2 of tinterest
    put item 3 of tdeal into item 3 of tinterest
    set the height of field "business" of me to the formattedheight of field "business" of me
    put (item 2 of tinterest + the height of field "business" of me) into item 4 of tinterest
    set the rect of field "business" of me to tinterest
    

   put item 4 of tinterest into tnext

     put the rect of field "website" of me into tfirst
     put item 1  of theMasterRect into item 1 of tfirst
     put tnext  into item 2 of tfirst
     set the height of field "website" of me to the formattedheight of field "website" of me
     put item 3 of tinterest into item 3 of tfirst
     put item 2 of tfirst + the height of field "website" of me into item 4 of tfirst
    set the rect of field "website" of me to tfirst
   

     put the rect of field "expires" of me into tinfo
     put item 1 of theMasterRect into item 1 of tinfo
     put item 4 of tfirst into item 2 of tinfo
      set the height of field "expires" of me to the formattedheight of field "expires" of me
   put item 2 of tinfo + the height of field "expires" of me into item 4 of tinfo
    set the rect of field "expires" of me to tinfo


    if twidth > 0 then
    put item 3 of themasterRect into tonce

    put tonce *.35 into tnewwidth
    put field "height" of me into theight

    put tnewwidth*theight/twidth into tnewheight
  
    
set the height of image "imagedeal" of me  to tnewheight
set the width of image "imagedeal" of me to tnewwidth

put the rect of image "imagedeal" of me into timage
put item 2 of themasterRect into item 2 of timage
put item 3 of themasterRect- tnewwidth into item 1 of timage
put item 3 of themasterRect into item 3 of timage
put item 2 of themasterRect + tnewheight into item 4 of timage
set the rect of image "imagedeal" of me to timage
else
   set the vis of image "imagedeal" of me to false
end if
put item 1 of timage into tright
put the rect of field "business" of me into tbiz2
put tright into item 3 of tbiz2
set the rect of  field "business" of me to tbiz2


    put the rect of field "expires" of me into texpires
put item 3 of timage into item 3 of texpires
put item 4 of timage  into item 2 of texpires
set the rect of field "expires" of me to texpires

         
    set the rect of graphic "Background" of me to pControlRect


end LayoutControl


on ResetData
    -- Sent when data is being emptied because the control is no longer being used to display data
    set the text of field "Label" of me to empty
end ResetData


on PreFillInData
    -- Sent right before new data is going to replace existing data in the control
end PreFillInData


setprop dgHilite pBoolean
    -- This custom property is set when the highlight of your custom template has
    -- changed. By default the "Background" graphic will be highlighted for you. 
    -- You only add script here if you want to further customize the highlight.
    
    -- Example:
    if pBoolean then
        set the foregroundColor of me to the dgProp["hilited text color"] of the dgControl of me
    else
        set the foregroundColor of me to empty
    end if
end dgHilite


getprop dgDataControl
    -- Required by library so that it can locate your control.
    return the long ID of me
end dgDataControl


on mouseDoubleUp pMouseBtnNum
    local theKey
    
    -- Example of how to edit the contents of a field.
    -- By passing the index of the record associated with copy of this template being displayed and
    -- a key (array key) the data grid will automatically save the changes the user
    -- makes and refresh the UI by calling FillInData and resizeControl.
    if pMouseBtnNum is 1 then
        if the dgProps["allow editing"] of the dgControl of me then
            switch the short name of the target
                case "Label"
                    put "Label 1" into theKey
                    EditFieldText the long ID of the target, the dgIndex of me, theKey
                    break                 
            end switch
        end if
    end if
    
    pass mouseDoubleUp
end mouseDoubleUp
This doesn't happen on any of the other datagrids I have. Can you see anything wrong? Thanks!

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”