~ubuntu-branches/debian/squeeze/stella/squeeze

« back to all changes in this revision

Viewing changes to src/debugger/gui/RomListWidget.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna, Franczen Attila, Luca Falavigna
  • Date: 2008-11-08 12:04:12 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20081108120412-w6xq87vzgokstfey
Tags: 2.6.1-0ubuntu1
[ Franczen Attila ]
* New upstream release (LP: #183571).
* Updated policy to 3.8.0.

[ Luca Falavigna ]
* debian/patches/gcc-4.3: fix FTBFS with gcc-4.3 compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
//  SS  SS   tt   ee      ll   ll  aa  aa
9
9
//   SSSS     ttt  eeeee llll llll  aaaaa
10
10
//
11
 
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
 
11
// Copyright (c) 1995-2008 by Bradford W. Mott and the Stella team
12
12
//
13
13
// See the file "license" for information on usage and redistribution of
14
14
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
15
15
//
16
 
// $Id: RomListWidget.cxx,v 1.5 2006/02/22 17:38:04 stephena Exp $
 
16
// $Id: RomListWidget.cxx,v 1.12 2008/05/11 21:18:34 stephena Exp $
17
17
//
18
18
//   Based on code from ScummVM - Scumm Interpreter
19
19
//   Copyright (C) 2002-2004 The ScummVM project
20
20
//============================================================================
21
21
 
 
22
#include "bspf.hxx"
22
23
#include "ContextMenu.hxx"
23
24
#include "RomListWidget.hxx"
24
25
 
29
30
    myMenu(NULL),
30
31
    myHighlightedItem(-1)
31
32
{
 
33
  _type = kRomListWidget;
 
34
 
32
35
  myMenu = new ContextMenu(this, font);
33
36
 
34
37
  StringList l;
38
41
 
39
42
  myMenu->setList(l);
40
43
 
41
 
  myLabelWidth  = font.getMaxCharWidth() * 16;
42
 
  myBytesWidth  = font.getMaxCharWidth() * 12;
 
44
  // Take advantage of a wide debugger window when possible
 
45
  const int fontWidth = font.getMaxCharWidth(),
 
46
            numchars = w / fontWidth;
 
47
 
 
48
  myLabelWidth = BSPF_max(20, int(0.35 * (numchars - 12))) * fontWidth;
 
49
  myBytesWidth = 12 * fontWidth;
43
50
}
44
51
 
45
52
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
72
79
}
73
80
 
74
81
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
82
bool RomListWidget::handleEvent(Event::Type e)
 
83
{
 
84
  return ListWidget::handleEvent(e); // override CheckListWidget::handleEvent()
 
85
}
 
86
 
 
87
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
75
88
void RomListWidget::drawWidget(bool hilite)
76
89
{
77
90
//cerr << "RomListWidget::drawWidget\n";
104
117
    if (_highlightedItem == pos)
105
118
    {
106
119
      fb.frameRect(_x + l.left - 3, _y + 1 + _fontHeight * i,
107
 
                   _w - l.left, _fontHeight,
108
 
                   kHiliteColor);
 
120
                   _w - l.left, _fontHeight, kDbgColorHi);
109
121
    }
110
122
 
111
123
    // Draw the selected item inverted, on a highlighted background.