label.cpp

Go to the documentation of this file.
00001 #ifndef LABEL_IMPLEMENTATION_FILE
00002 #define LABEL_IMPLEMENTATION_FILE
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : label                                                             *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 1991-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 #include "argument_list.h"
00019 #include "label.h"
00020 #include "system_string.h"
00021 #include "wp_implementation.h"
00022 
00023 #include <Xm/Label.h>
00024 
00025 label::label(manager &root, const c_point &origin, const char *message,
00026     const color &foreground, const color &background)
00027 : worker(root, c_rectangle(origin, origin),
00028       create_label_handle(root, message, origin),
00029       foreground, background)
00030 {}
00031 
00032 label::~label() {}
00033 
00034 window_handle label::create_label_handle(manager &root,
00035     const istring &message, const c_point &origin)
00036 {
00037   argument_list wargs;
00038   system_string to_send(message);
00039   wargs.add(XmNlabelString, to_send);
00040   add_origin(wargs, root.universe_to_device(origin));
00041   return XtCreateManagedWidget
00042     ("label", xmLabelWidgetClass, root.self(),
00043      wargs.generate(), wargs.number());
00044 }
00045 
00046 void label::reset(const char *new_message)
00047 {
00048   argument_list wargs;
00049   system_string to_send(new_message);
00050   wargs.add(XmNlabelString, to_send);
00051   wargs.apply(self());
00052 }
00053 
00054 
00055 #endif //LABEL_IMPLEMENTATION_FILE
00056 

Generated on Fri Nov 28 04:29:04 2008 for HOOPLE Libraries by  doxygen 1.5.1