~ubuntu-branches/ubuntu/karmic/texmacs/karmic

« back to all changes in this revision

Viewing changes to src/Plugins/Widkit/Button/popup_button.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Atsuhito KOHDA, Kamaraju Kusumanchi, kohda
  • Date: 2009-04-26 19:35:14 UTC
  • mfrom: (1.1.10 upstream) (4.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090426193514-9yo3oggdslgdls4b
Tags: 1:1.0.7.2-1
[Kamaraju Kusumanchi <kamaraju@gmail.com>]
* New upstream release
* texmacs crashes if /usr/share/texmacs/TeXmacs/misc/pixmaps/unknown.ps
  is not present. Do not remove it. (Closes: #484073, #497021)
* update patches 03_mupad.dpatch, 04_axiom.dpatch, 11-desktop-file.dpatch
* fix the mime problem in gnome. Thanks to Andrea Gamba for the fix.
[kohda]
* Refined a fix for the mime problem in gnome a bit.
* Try to fix /bin/sh problem (debian/fixsh) but it is not complete fix yet.
* Try to fix hard coded settings for ipa fonts(patches/09_ipa.dpatch), 
  especially for Debian where no ipa fonts exist yet.
* Fixed obsolete Build-Depends: changed libltdl3-dev to 
  libltdl-dev | libltdl7-dev (the latter for Ubuntu?)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
* DESCRIPTION: Buttons which trigger a popup window.
5
5
* COPYRIGHT  : (C) 1999  Joris van der Hoeven
6
6
*******************************************************************************
7
 
* This software falls under the GNU general public license and comes WITHOUT
8
 
* ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
9
 
* If you don't have this file, write to the Free Software Foundation, Inc.,
10
 
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
7
* This software falls under the GNU general public license version 3 or later.
 
8
* It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
 
9
* in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
11
10
******************************************************************************/
12
11
 
13
12
#include "timer.hpp"
62
61
    where (wh), require_map (false), stick (false)
63
62
{
64
63
  if ((where!=east) && (where!=south) && (where!=south_east))
65
 
    fatal_error ("direction not implemented",
66
 
                 "popup_button_rep::popup_button_rep");
 
64
    WK_FAILED ("direction not implemented");
67
65
}
68
66
 
69
67
popup_button_rep::popup_button_rep (
73
71
    where (where2), require_map (false), stick (false)
74
72
{
75
73
  if ((where!=east) && (where!=south) && (where!=south_east))
76
 
    fatal_error ("direction not implemented",
77
 
                 "popup_button_rep::popup_button_rep");
 
74
    WK_FAILED ("direction not implemented");
78
75
}
79
76
 
80
77
void
93
90
    cerr << "status     = " << status << "\n";
94
91
    cerr << "require map= " << require_map << "\n";
95
92
    cerr << "popup      = " << (popup != NULL) << "\n";
96
 
    fatal_error ("Inconsistency in " * s, "popup_button_rep::consistent");
 
93
    WK_FAILED ("inconsistency in " * s);
97
94
  }
98
95
}
99
96
 
147
144
 
148
145
void
149
146
popup_button_rep::unmap_popup () {
150
 
  if (popup == NULL)
151
 
    fatal_error ("Unexpected situation", "popup_button_rep::unmap_popup");
 
147
  if (popup == NULL) WK_FAILED ("unexpected situation");
152
148
  popup->set_visibility (false);
153
 
  delete popup;
 
149
  tm_delete (popup);
154
150
  popup= NULL;
155
151
  if (!is_nil (prom)) popup_w= wk_widget ();
156
152
 
157
153
  this << emit_invalidate_all ();
158
154
  if (!wk_has_pointer_grab (this))
159
 
    fatal_error ("I do not have the pointer grab",
160
 
                 "popup_button_rep::unmap_popup");
 
155
    WK_FAILED ("I do not have the pointer grab");
161
156
  wk_ungrab_pointer (this);
162
157
}
163
158
 
288
283
  case south     : return north;
289
284
  case south_east: return north_west;
290
285
  }
291
 
  fatal_error ("unknown gravity", "operator -", "popup_button.cpp");
 
286
  FAILED ("unknown gravity");
292
287
  return center; // Because of bug in certain versions of g++
293
288
}
294
289
 
298
293
 
299
294
wk_widget
300
295
pulldown_button (wk_widget w, wk_widget pw, bool button_flag) {
301
 
  return new popup_button_rep (w, pw, south_east, button_flag);
 
296
  return tm_new<popup_button_rep> (w, pw, south_east, button_flag);
302
297
}
303
298
 
304
299
wk_widget
305
300
pullright_button (wk_widget w, wk_widget pw, bool button_flag) {
306
 
  return new popup_button_rep (w, pw, east, button_flag);
 
301
  return tm_new<popup_button_rep> (w, pw, east, button_flag);
307
302
}
308
303
 
309
304
wk_widget
310
305
pulldown_button (wk_widget w, promise<wk_widget> prom) {
311
 
  return new popup_button_rep (w, prom, south_east);
 
306
  return tm_new<popup_button_rep> (w, prom, south_east);
312
307
}
313
308
 
314
309
wk_widget
315
310
pullright_button (wk_widget w, promise<wk_widget> prom) {
316
 
  return new popup_button_rep (w, prom, east);
 
311
  return tm_new<popup_button_rep> (w, prom, east);
317
312
}