static void init( // MODULE INITIALIZATION INITFINI* defn ) // - definition { defn = defn; defined_type = TY_FIRST_FREE; cg_member_ptr = NULL_CGREFNO; #if _CPU == _AXP defaultDataPtrClass = PTR_NEAR; defaultCodePtrClass = PTR_NEAR; #elif _INTEL_CPU defaultDataPtrClass = PTR_NEAR; defaultCodePtrClass = PTR_NEAR; if( !IsFlat() ) { if( IsHugeData() ) { defaultDataPtrClass = PTR_HUGE; } else if( IsBigData() ) { defaultDataPtrClass = PTR_LONG; } if( IsBigCode() ) { defaultCodePtrClass = PTR_LONG; } } #else #error bad target #endif }
// // Intercept WM_PAINT to redirect from TWindow to the underlying control iff // this Owl object is just a wrapper for a predefined class. // void TFlatEdit::EvPaint() { TEdit::EvPaint(); if (IsFlat()) { TWindowDC dc(GetHandle()); TRect rect = GetClientRect(); //28.11.2007 Jogy - painting of the was wrong, added some corrections rect.top -= 4; rect.left -= 4; rect.right += 6; rect.bottom += 6; TFlatPainter::Paint(dc, rect); } }
// // Intercept WM_PAINT to redirect from TWindow to the underlying control iff // this Owl object is just a wrapper for a predefined class. // void TFlatComboBox::EvPaint() { TComboBox::EvPaint(); if (IsFlat()){ TWindowDC dc(GetHandle()); TRect rect = GetClientRect(); TFlatPainter::Paint(dc, rect); if(!IsSet(fpMouseIn) || !IsWindowEnabled()){ // We draw the "untracked" situation rect.left = rect.right - TUIMetric::CxHThumb;// + 1; #ifdef TEST dc.FrameRect(rect, TBrush(TColor::LtGreen)); #else dc.FrameRect(rect, TBrush(TColor::SysWindow)); #endif } } }
// // Intercept WM_PAINT to redirect from TWindow to the underlying control iff // this Owl object is just a wrapper for a predefined class. // void TFlatListBox::EvPaint() { TListBox::EvPaint(); if (IsFlat()){ TWindowDC dc(GetHandle()); TRect rect = GetClientRect(); TRect wrect = GetWindowRect(); ::MapWindowPoints(HWND_DESKTOP, *this, LPPOINT(&wrect), 2); rect.bottom += 6; rect.right += 6; wrect.Offset(3,3); bool haveScroll = wrect != rect; if(haveScroll){ wrect.bottom -= 1; wrect.right -= 1; } TFlatPainter::Paint(dc, wrect); if((!IsSet(fpMouseIn) || !IsWindowEnabled()) && haveScroll){ // We draw the "untracked" situation wrect.left = wrect.right - TUIMetric::CxHThumb; #ifdef TEST dc.FrameRect(wrect, TBrush(TColor::LtGreen)); #else dc.FrameRect(wrect, TBrush(TColor::SysWindow)); #endif } } }
back_handle DgStringConst( // STORE STRING CONSTANT WITH NULL STRING_CONSTANT str, // - string to store uint_16 *psegid, // - addr(string segid) unsigned control ) // - control mask (DSC_*) { back_handle handle; // - back handle for literal target_offset_t str_align; // - string's alignment target_size_t str_len; // - string's length (in bytes) segment_id str_seg; // - string's segment segment_id old_seg; // - old segment str_seg = str->segid; handle = str->cg_handle; if( control & DSC_CONST ) { if( handle == 0 ) { handle = BENewBack( 0 ); str->cg_handle = handle; str_len = str->len + TARGET_CHAR; if( str->wide_string ) { str_align = TARGET_WIDE_CHAR; } else { str_align = TARGET_CHAR; } #if _CPU == _AXP str_seg = SEG_CONST; #else if( CompFlags.strings_in_code_segment && ( control & DSC_CODE_OK ) != 0 ) { if( IsBigData() ) { str_seg = SegmentAddStringCodeFar( str_len, str_align ); } else { if( IsFlat() ) { str_seg = SegmentAddStringCodeFar( str_len, str_align ); } else { str_seg = SEG_CONST; } } } else { if( IsBigData() ) { str_seg = SegmentAddStringConstFar( str_len, str_align ); } else { str_seg = SEG_CONST; } } #endif str->segid = str_seg; old_seg = BESetSeg( str_seg ); #if _CPU == _AXP DGAlign( TARGET_INT ); #else DGAlign( str_align ); // NT requires word aligned wide strings #endif DGLabel( handle ); DGString( str->string, str->len ); DgByte( 0 ); #if _CPU == _AXP DGAlign( TARGET_INT ); #endif BESetSeg( old_seg ); } } else { // char a[] = "asdf"; initialization (use current segment) str_seg = DgCurrSeg(); str->segid = str_seg; DGString( str->string, str->len ); DgByte( 0 ); } if( psegid != NULL ) { *psegid = str_seg; } return( handle ); }