~ubuntu-branches/ubuntu/trusty/lmms/trusty

« back to all changes in this revision

Viewing changes to plugins/zynaddsubfx/fltk/src/Fl_Table.cxx

  • Committer: Charlie Smotherman
  • Date: 2012-12-05 22:08:38 UTC
  • mfrom: (33.1.7 lmms_0.4.13)
  • Revision ID: cjsmo@cableone.net-20121205220838-09pjfzew9m5023hr
* New  Upstream release.
  - Minor tweaking to ZynAddSubFX, CALF, SWH plugins  and Stefan Fendt's RC
    filters.
  - Added UI fixes: Magnentic effect of knobs and Piano-roll fixes
  - Updated German localization and copyright year
* debian/lmms-common.install:
  - added /usr/share/applications so the lmms.desktop file will correctly
    install (LP: #863366)
  - This should also fix the Software Center not displaying lmms in sound
    and video (LP: #824231)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
 
// "$Id: Fl_Table.cxx 7117 2010-02-20 21:14:47Z matt $"
 
2
// "$Id: Fl_Table.cxx 7950 2010-12-05 01:22:53Z greg.ercolano $"
3
3
//
4
4
// Fl_Table -- A table widget
5
5
//
424
424
  if (lx > x() + w() - 20) {
425
425
    Fl::e_x = x() + w() - 20;
426
426
    if (hscrollbar->visible())
427
 
      ((Fl_Slider*)hscrollbar)->value(
428
 
                                      hscrollbar->clamp(hscrollbar->value() + 30));
 
427
      ((Fl_Slider*)hscrollbar)->value(hscrollbar->clamp(hscrollbar->value() + 30));
429
428
    hscrollbar->do_callback();
430
429
    _dragging_x = Fl::e_x - 30;
431
430
  }
432
431
  else if (lx < (x() + row_header_width())) {
433
432
    Fl::e_x = x() + row_header_width() + 1;
434
 
    if (hscrollbar->visible())  {
 
433
    if (hscrollbar->visible()) {
435
434
      ((Fl_Slider*)hscrollbar)->value(hscrollbar->clamp(hscrollbar->value() - 30));
436
435
    }
437
436
    hscrollbar->do_callback();
514
513
    if ( y > voff ) { y -= row_height(row); break; }
515
514
  }
516
515
  _row_position = toprow = ( row >= _rows ) ? (row - 1) : row;
517
 
  toprow_scrollpos = y; // OPTIMIZATION: save for later use 
 
516
  toprow_scrollpos = y;         // OPTIMIZATION: save for later use 
518
517
  // Find bottom row
519
518
  voff = vscrollbar->value() + tih;
520
519
  for ( ; row < _rows; row++ ) {
990
989
        case FL_Down:
991
990
          ret = move_cursor(1, 0);
992
991
          break;
 
992
        case FL_Tab:
 
993
          if ( Fl::event_state() & FL_SHIFT ) {
 
994
            ret = move_cursor(0, -1);           // shift-tab -> left
 
995
          } else {
 
996
            ret = move_cursor(0, 1);            // tab -> right
 
997
          }
 
998
          break;
993
999
      }
994
1000
      if (ret && Fl::focus() != this) {
995
1001
        do_callback(CONTEXT_TABLE, -1, -1);
1034
1040
  draw_cell(context, r, c, X, Y, W, H); // call users' function to draw it
1035
1041
}
1036
1042
 
 
1043
/**
 
1044
 See if the cell at row \p r and column \p c is selected.
 
1045
 \returns 1 if the cell is selected, 0 if not.
 
1046
 */
1037
1047
int Fl_Table::is_selected(int r, int c) {
1038
1048
  int s_left, s_right, s_top, s_bottom;
1039
1049
  
1057
1067
  return 0;
1058
1068
}
1059
1069
 
1060
 
void Fl_Table::get_selection(int& s_top, int& s_left, int& s_bottom, int& s_right) {
 
1070
/**
 
1071
  Gets the region of cells selected (highlighted).
 
1072
 
 
1073
  \param[in] row_top   Returns the top row of selection area
 
1074
  \param[in] col_left  Returns the left column of selection area
 
1075
  \param[in] row_bot   Returns the bottom row of selection area
 
1076
  \param[in] col_right Returns the right column of selection area
 
1077
*/
 
1078
void Fl_Table::get_selection(int& row_top, int& col_left, int& row_bot, int& col_right) {
1061
1079
  if (select_col > current_col) {
1062
 
    s_left = current_col;
1063
 
    s_right = select_col;
 
1080
    col_left  = current_col;
 
1081
    col_right = select_col;
1064
1082
  } else {
1065
 
    s_right = current_col;
1066
 
    s_left = select_col;
 
1083
    col_right = current_col;
 
1084
    col_left  = select_col;
1067
1085
  }
1068
1086
  if (select_row > current_row) {
1069
 
    s_top = current_row;
1070
 
    s_bottom = select_row;
 
1087
    row_top = current_row;
 
1088
    row_bot = select_row;
1071
1089
  } else {
1072
 
    s_bottom = current_row;
1073
 
    s_top = select_row;
 
1090
    row_bot = current_row;
 
1091
    row_top = select_row;
1074
1092
  }
1075
1093
}
1076
1094
 
1077
 
void Fl_Table::set_selection(int s_top, int s_left, int s_bottom, int s_right) {
 
1095
/**
 
1096
  Sets the region of cells to be selected (highlighted).
 
1097
 
 
1098
  So for instance, set_selection(0,0,0,0) selects the top/left cell in the table.
 
1099
  And set_selection(0,0,1,1) selects the four cells in rows 0 and 1, column 0 and 1.
 
1100
 
 
1101
  \param[in] row_top   Top row of selection area
 
1102
  \param[in] col_left  Left column of selection area
 
1103
  \param[in] row_bot   Bottom row of selection area
 
1104
  \param[in] col_right Right column of selection area
 
1105
*/
 
1106
void Fl_Table::set_selection(int row_top, int col_left, int row_bot, int col_right) {
1078
1107
  damage_zone(current_row, current_col, select_row, select_col);
1079
 
  current_col = s_left;
1080
 
  current_row = s_top;
1081
 
  select_col = s_right;
1082
 
  select_row = s_bottom;
 
1108
  current_col = col_left;
 
1109
  current_row = row_top;
 
1110
  select_col  = col_right;
 
1111
  select_row  = row_bot;
1083
1112
  damage_zone(current_row, current_col, select_row, select_col);
1084
1113
}
1085
1114
 
1220
1249
}
1221
1250
 
1222
1251
//
1223
 
// End of "$Id: Fl_Table.cxx 7117 2010-02-20 21:14:47Z matt $".
 
1252
// End of "$Id: Fl_Table.cxx 7950 2010-12-05 01:22:53Z greg.ercolano $".
1224
1253
//