📄 test15.c
字号:
printf ( "\n\n*******************************************************************\n" ); printf ( "*******calling _XmTextPosToLine( w, 10 );\n" ); line = _XmTextPosToLine( textw, 10 ); printf ( "result = %i \n\n", line ); PrintDiffs ( textw ); printf ( "\n\n*******************************************************************\n" ); printf ( "*******calling _XmTextPosToLine( w, 1 );\n" ); line = _XmTextPosToLine( textw, 1 ); printf ( "result = %i \n\n", line ); PrintDiffs ( textw ); printf ( "\n\n*******************************************************************\n" ); printf ( "*******calling _XmTextSetCursorPosition( w, 30 );\n" ); _XmTextSetCursorPosition( w, 30 ) ; PrintDiffs ( textw ); printf ( "\n\n*******************************************************************\n" ); printf ( "*******calling _XmTextSetCursorPosition( w, 50 );\n" ); _XmTextSetCursorPosition( w, 50 ) ; PrintDiffs ( textw ); printf ( "\n\n*******************************************************************\n" ); printf ( "*******calling _XmTextGetTableIndex( w, 50 );\n" ); pos = _XmTextGetTableIndex( (XmTextWidget)w, 50 ) ; printf ( "result = %i \n\n", (int)pos ); { int numberOfLines ; PrintDiffs ( textw ); printf ( "\n\n*******************************************************************\n" ); printf ( "*******calling _XmTextGetNumberLines ( w );\n" ); numberOfLines = _XmTextGetNumberLines( textw ) ; printf ( "result = %i \n\n", (int)numberOfLines ); } { int totalLines ; PrintDiffs ( textw ); printf ( "\n\n*******************************************************************\n" ); printf ( "*******calling _XmTextGetTotalLines ( w );\n" ); totalLines = _XmTextGetTotalLines( w ) ; printf ( "result = %i \n\n", (int)totalLines ); } { int totalLines ; PrintDiffs ( textw ); printf ( "\n\n*******************************************************************\n" ); printf ( "*******calling _XmTextNumLines ( w );\n" ); totalLines = _XmTextNumLines( textw ) ; printf ( "result = %i \n\n", (int)totalLines ); } { PrintDiffs ( textw ); printf ( "\n\n*******************************************************************\n" ); printf ( "*******calling _XmTextMovingCursorPosition( textw, 7 );\n" ); _XmTextMovingCursorPosition( textw, 7 ); } if(0){ XmTextBlockRec block; block.length = 0; PrintDiffs ( textw ); printf ( "\n\n*******************************************************************\n" ); printf ( "*******calling _XmTextUpdateLineTable( w, 5, 25, NULL, 0 );\n" ); _XmTextUpdateLineTable( w, 5, 25, &block, 0 ) ; } if ( 0 ){ Widget secondText = XmCreateScrolledText ( XtParent(w), "text2", NULL, 0 ); XtManageChild ( secondText ); XtVaSetValues ( secondText, XmNsource, GetSrc ( w ), NULL ); }/* to test :extern XmTextPosition _XmTextFindScroll( XmTextWidget widget, XmTextPosition start, int delta) ;extern XmTextLineTable _XmTextGetLineTable( Widget widget, int *total_lines) ;extern void _XmTextRealignLineTable( XmTextWidget widget, XmTextLineTable *temp_table, int *temp_table_size, register unsigned int cur_index, register XmTextPosition cur_start, register XmTextPosition cur_end) ;extern void _XmTextLineInfo( XmTextWidget widget, LineNum line, XmTextPosition *startpos, LineTableExtra *extra) ;extern int _XmTextCountCharacters( char *str, int num_count_bytes) ;--- from Out:extern void _XmTextFreeContextData( Widget w, XtPointer clientData, XtPointer callData) ;extern void _XmTextResetClipOrigin( XmTextWidget tw, XmTextPosition position, int clip_mask_reset) ;extern void _XmTextAdjustGC( XmTextWidget tw) ;extern Boolean _XmTextShouldWordWrap( XmTextWidget widget) ;extern Boolean _XmTextScrollable( XmTextWidget widget) ;extern XmTextPosition _XmTextFindLineEnd( XmTextWidget widget, XmTextPosition position, LineTableExtra *extra) ;extern void _XmTextOutputGetSecResData( XmSecondaryResourceData *secResDataRtn) ;extern void _XmTextDrawDestination( XmTextWidget widget) ;extern void _XmTextClearDestination( XmTextWidget widget, int ignore_sens) ;extern void _XmTextDestinationVisible( Widget w, int turn_on) ;extern void _XmTextChangeBlinkBehavior( XmTextWidget widget, int newvalue) ;extern Boolean _XmTextGetBaselines( Widget widget, Dimension **baselines, int *line_count) ;extern Boolean _XmTextGetDisplayRect( Widget w, XRectangle *display_rect) ;extern void _XmTextMarginsProc( Widget w, XmBaselineMargins *margins_rec) ;extern void _XmTextChangeHOffset( XmTextWidget widget, int length) ;extern void _XmTextToggleCursorGC( Widget widget) ;extern Widget _XmTextGetDropReciever( Widget w) ;extern Boolean _XmTextHasDestination( Widget w) ;extern Boolean _XmTextSetDestinationSelection( Widget w, XmTextPosition position, int disown, Time set_time) ;extern void _XmTextInputGetSecResData( XmSecondaryResourceData *secResDataRtn) ;extern XmTextPosition _XmTextGetAnchor( XmTextWidget tw) ;-- SOURCEextern char * _XmStringSourceGetString( XmTextWidget tw, XmTextPosition from, XmTextPosition to, int want_wchar) ;extern Boolean _XmTextFindStringBackwards( Widget w, XmTextPosition start, char *search_string, XmTextPosition *position) ;extern Boolean _XmTextFindStringForwards( Widget w, XmTextPosition start, char *search_string, XmTextPosition *position) ;extern Boolean _XmStringSourceFindString( Widget w, XmTextPosition start, char *string, XmTextPosition *position) ;extern void _XmStringSourceSetGappedBuffer( XmSourceData data, XmTextPosition position) ;extern Boolean _XmTextModifyVerify( XmTextWidget initiator, XEvent *event, XmTextPosition *start, XmTextPosition *end, XmTextPosition *cursorPos, XmTextBlock block, XmTextBlock newblock, Boolean *freeBlock) ;extern XmTextSource _XmStringSourceCreate( char *value, int is_wchar) ;extern void _XmStringSourceDestroy( XmTextSource source) ;extern char * _XmStringSourceGetValue( XmTextSource source, int want_wchar) ;extern void _XmStringSourceSetValue( XmTextWidget widget, char *value) ;extern Boolean _XmStringSourceHasSelection( XmTextSource source) ;extern Boolean _XmStringSourceGetEditable( XmTextSource source) ;extern void _XmStringSourceSetEditable( XmTextSource source, int editable) ;extern int _XmStringSourceGetMaxLength( XmTextSource source) ;extern void _XmStringSourceSetMaxLength( XmTextSource source, int max) ;extern void _XmTextValueChanged(XmTextWidget initiator, XEvent *event);*/ PrintDiffs ( (XmTextWidget)w );}#endifXmTextPosition MyXYToPos( XmTextWidget w, Position x, Position y){ XmTextPosition result; indent++; PrintDiffs(w); PrintLead(); printf ( "XYToPos started with args x=%i y=%i\n", x, y ); result = DefaultXYToPos ( w, x, y ); PrintDiffs ( w ); PrintLead(); printf ( "XYToPos: stop with result %i\n", (int) result ); indent--; return result;}Boolean MyPosToXY( XmTextWidget w, XmTextPosition pos, Position *x, Position *y){ Boolean result; indent++; PrintDiffs ( w ); PrintLead(); printf ( "PosToXY: start with arg pos=%i\n", (int)pos );#ifdef SHOW_INITIAL_VALUES_FOR_IO_PARAMS printf ( "\t\tinitial values for *x=%i *y=%i\n", (int)*x, (int)*y );#endif result = DefaultPosToXY ( w, pos, x, y ); PrintLead(); if ( result ) printf ( "PosToXY: stop with results x=%i y=%i\n", (int)*x, (int)*y ); else printf ( "PosToXY: stop with false\n" ); indent--; return result;}void MyGetPreferredSize( Widget w, Dimension *width, Dimension *height){ indent++; PrintDiffs ( (XmTextWidget)w ); PrintLead(); printf ( "OutputGetPreferredSize: start\n");#ifdef SHOW_INITIAL_VALUES_FOR_IO_PARAMS printf ( "\t\tinitial values for width=%i height=%i\n", *width, *height );#endif DefaultGetPreferredSize ( w, width, height ); PrintDiffs ( (XmTextWidget)w ); PrintLead(); printf ( "OutputGetPreferredSize: stop with width=%i height=%i\n", *width, *height ); indent--;}Boolean MyOutputSetValues( Widget oldw, Widget reqw, Widget new, ArgList args, Cardinal *numArgs){ Boolean result; indent++; PrintDiffs ( (XmTextWidget)new ); PrintLead(); printf ( "OutputSetValues: start\n" ); result = DefaultOutputSetValues ( oldw, reqw, new, args, numArgs ); PrintDiffs ( (XmTextWidget)new ); PrintLead(); printf ( "OutputSetValues: stop with result %s\n", ( result ? "true" : "false" ) ); indent--; return result;}void MyOutputGetValues( Widget w, ArgList args, Cardinal numArgs){ indent++; PrintDiffs ( (XmTextWidget)w ); PrintLead(); printf ( "OutputGetValues: start\n" ); DefaultOutputGetValues ( w, args, numArgs ); PrintDiffs ( (XmTextWidget)w ); PrintLead(); printf ( "OutputGetValues: stop\n" ); indent--;}void MyOutputRealize( Widget w, Mask *mask, XSetWindowAttributes *attrs){ indent++; PrintDiffs ( (XmTextWidget)w ); PrintLead(); printf ( "OutputRealize: start\n" ); DefaultOutputRealize ( w, mask, attrs ); PrintDiffs ( (XmTextWidget)w ); PrintLead(); printf ( "OutputRealize: stop\n" ); indent--;}void MyOutputResize( Widget w, Boolean flag){ indent++; PrintDiffs ( (XmTextWidget)w ); PrintLead(); printf ( "OutputResize: start\n" ); DefaultOutputResize ( w, flag ); PrintDiffs ( (XmTextWidget)w ); PrintLead(); printf ( "OutputResize: stop\n" ); indent--;}void MyOutputExpose( Widget widget, XEvent* event, Region region ){ indent++; PrintDiffs ( (XmTextWidget)widget ); PrintLead(); printf ( "OutputExpose: start\n" ); DefaultOutputExpose ( widget, event, region ); PrintDiffs ( (XmTextWidget)widget ); PrintLead(); printf ( "OutputExpose: stop\n" ); indent--;}void MyInitialize ( Widget request, Widget new, ArgList args, Cardinal* num_args ){#ifdef VERBOSE_INIT XmTextWidget text = (XmTextWidget)request; indent++;/* not necessary since this is the first thing we will do PrintDiffs ( (XmTextWidget)new );*/ PrintLead(); printf ( "Initialize: start\n" );#endif#ifdef INITIALIAZE_MYPROCS_AT_OUTPUT_CREATION_PROC#endif#ifdef VERBOSE_INIT PrintDiffs ( (XmTextWidget)new ); PrintLead(); printf ( "Initialize: stop\n" ); indent--;#endif}/*-------------------------------------------------------------** CreateText** Create Text.*/Widget CreateText ( Widget parent ) { Widget textA, w, form; XmTextWidget textWid; Arg al[25]; /* arg list */ Cardinal ac, n; /* arg count */ ac = 0; XtSetArg (al[ac], XmNnavigationType, XmNONE );ac++; form = XmCreateForm (parent, "TextForm", al, ac ); XtManageChild ( form ); InitTextInternals(); { XmTextClassRec* textC
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -