Subversion Repositories tpanel

Rev

Rev 146 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 146 Rev 154
Line 1144... Line 1144...
1144
    {
1144
    {
1145
        TButton *but = button->button;
1145
        TButton *but = button->button;
1146
        bool clickable = but->isClickable();
1146
        bool clickable = but->isClickable();
1147
        MSG_DEBUG("Testing button " << but->getButtonIndex() << " (" << but->getButtonName() << "): " << (clickable ? "CLICKABLE" : "NOT CLICKABLE"));
1147
        MSG_DEBUG("Testing button " << but->getButtonIndex() << " (" << but->getButtonName() << "): " << (clickable ? "CLICKABLE" : "NOT CLICKABLE"));
1148
 
1148
 
1149
        if (x > but->getLeftPosition() && x < (but->getLeftPosition() + but->getWidth()) &&
1149
        if (clickable && x > but->getLeftPosition() && x < (but->getLeftPosition() + but->getWidth()) &&
1150
            y > but->getTopPosition() && y < (but->getTopPosition() + but->getHeight()))
1150
            y > but->getTopPosition() && y < (but->getTopPosition() + but->getHeight()))
1151
        {
1151
        {
1152
            MSG_DEBUG("Clicking button " << but->getButtonIndex() << ": " << but->getButtonName() << " to state " << (pressed ? "PRESS" : "RELEASE"));
1152
            MSG_DEBUG("Clicking button " << but->getButtonIndex() << ": " << but->getButtonName() << " to state " << (pressed ? "PRESS" : "RELEASE"));
1153
            int btX = x - but->getLeftPosition();
1153
            int btX = x - but->getLeftPosition();
1154
            int btY = y - but->getTopPosition();
1154
            int btY = y - but->getTopPosition();
1155
 
1155
 
1156
            if (but->doClick(btX, btY, pressed))
1156
            if (but->doClick(btX, btY, pressed))
1157
                break;
1157
                break;
1158
        }
1158
        }
1159
        else if (clickable)
-
 
1160
        {
-
 
1161
            MSG_DEBUG("Button out of position: L " << but->getLeftPosition() << ", R " << (but->getLeftPosition() + but->getWidth()) << ", T " << but->getTopPosition() << ", B " << (but->getTopPosition() + but->getHeight()) << " --> " << x << ":" << y);
-
 
1162
        }
-
 
1163
 
1159
 
1164
        button = button->previous;
1160
        button = button->previous;
1165
    }
1161
    }
1166
}
1162
}