From d1a8285f818eb7e5c3d6a05709ea21a808490b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Mon, 19 Mar 2018 19:55:58 +0100 Subject: New upstream version 5.1.0 --- app/wlib/mswlib/mswstatus.c | 110 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 app/wlib/mswlib/mswstatus.c (limited to 'app/wlib/mswlib/mswstatus.c') diff --git a/app/wlib/mswlib/mswstatus.c b/app/wlib/mswlib/mswstatus.c new file mode 100644 index 0000000..f9d72f4 --- /dev/null +++ b/app/wlib/mswlib/mswstatus.c @@ -0,0 +1,110 @@ +/** \file mswstatus.c + * Status bar + */ + +/* XTrkCad - Model Railroad CAD + * Copyright (C) 2005 Dave Bullis, + * 2017 Martin Fischer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + * + */ + +#include +#include +#include + +#include "mswint.h" + +/** + * Set the message text + * + * \param b IN widget + * \param arg IN new text + * \return + */ + +void wStatusSetValue( + wStatus_p b, + const char * arg) +{ + wMessageSetValue((wMessage_p)b, arg); +} +/** + * Create a window for a simple text. + * + * \param IN parent Handle of parent window + * \param IN x position in x direction + * \param IN y position in y direction + * \param IN labelStr ??? + * \param IN width horizontal size of window + * \param IN message message to display ( null terminated ) + * \param IN flags display options + * \return handle for created window + */ + +wStatus_p wStatusCreate( + wWin_p parent, + wPos_t x, + wPos_t y, + const char * labelStr, + wPos_t width, + const char *message) +{ + return (wStatus_p)wMessageCreateEx(parent, x, y, labelStr, width, message, 0); +} + +/** + * Get the anticipated length of a message field + * + * \param testString IN string that should fit into the message box + * \return expected width of message box + */ + +wPos_t +wStatusGetWidth(const char *testString) +{ + return (wMessageGetWidth(testString)); +} + +/** + * Get height of message text + * + * \param flags IN text properties (large or small size) + * \return text height + */ + +wPos_t wStatusGetHeight( + long flags) +{ + return (wMessageGetHeight(flags)); +} + +/** + * Set the width of the widget + * + * \param b IN widget + * \param width IN new width + * \return + */ + +void wStatusSetWidth( + wStatus_p b, + wPos_t width) +{ + wMessageSetWidth((wMessage_p)b, width); +} \ No newline at end of file -- cgit v1.2.3