📄 memberout.cc
字号:
//**************************************************************//* filename: memberout.cc *//* *//**************************************************************//* programmed by: Thomas Wagner *//* last change: 21-05-95 *//**************************************************************#include <stdio.h>#include <stdlib.h>#include <string.h>#include "memberout.h"extern unsigned long buttonpix, blackpix, whitepix, shadowpix, lightpix;extern Cursor maincursor;MemberOutput::MemberOutput (Display * initdisplay, GC initgc,// ClusterOutput *initclusteroutput, XFontStruct * initfontstruct, int initx, int inity, char *inittext):BigWindow (initdisplay, initgc, DefaultRootWindow (initdisplay), initfontstruct, initx, inity, 100, 100, inittext, DEFAULT_BDWIDTH){//clusteroutput=initclusteroutput; SetSelectedInput (ExposureMask | StructureNotifyMask);}void MemberOutput::SetResult (DVektor newresult, Clustering * theclustering){ result = newresult; clustering = theclustering; Redraw ();}void MemberOutput::Redraw (){ short textheight = fontstruct->max_bounds.ascent + fontstruct->max_bounds.descent; char temptext[30]; // should be enought sprintf (temptext, "cluster no.%d: 0.000000", result.Lese_Dim ()); short textwidth = XTextWidth (fontstruct, temptext, strlen (temptext)); SizeMe (2 * MEMBEROUTPUTBORDER + textwidth, 2 * MEMBEROUTPUTBORDER + result.Lese_Dim () * textheight); FixMySize (); XSetForeground (display, gc, whitepix); XFillRectangle (display, window, gc, 0, 0, width, height); XSetForeground (display, gc, blackpix); short counter; for (counter = 0; counter < result.Lese_Dim (); counter++) { sprintf (temptext, "cluster no.%d: %1.6f", clustering->Lese_Cluster (counter).Lese_Nummer (), result[counter]); XDrawString (display, window, gc, MEMBEROUTPUTBORDER, MEMBEROUTPUTBORDER + (counter + 1) * textheight, temptext, strlen (temptext)); }}void MemberOutput::Action (int Actionnumber, int value){}void MemberOutput::HandleEvent (XEvent * Event){ switch (Event->type) { case Expose: Redraw (); break; case UnmapNotify: XWithdrawWindow (display, window, DefaultScreen (display)); break; case MapNotify: break; }}MemberOutput::~MemberOutput (){ UnmapMe ();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -