void AskExit() { if(CheckIfModified()==TRUE) { SetColor(LIGHTWHITE); SetBackColor(RED); OpenWindow(10,24,5,32); SetColor(YELLOW); Print_At(11,29,"Apply Changes on Exit?"); SetColor(BLUE); SetBackColor(WHITE); SetBlink(ON); Print_At(13,32," <Yes> "); Print_At(13,42," <No> "); SetBlink(OFF); GetKey(); } CloseAllWindows(); VideoReset(); if(keycode!=ESC && keychar!='n' && keychar!='N') if(WriteHeader(&id32)!=0) { printf("%s could not write to file\n" ,errstr); exit(1); } CloseFile(); exit(0); }
void RestoreConfig() { int n; char *envname; char envbuf[256]; char *name; char *ptr; char buf[80]; SetColor(LIGHTWHITE); SetBackColor(BLUE); OpenWindow(10,10,3,60); SetColor(YELLOW); Print_At(10,13," Restore Predefined Configuration "); SetColor(LIGHTWHITE); Print_At(11,12,"Enter file name:"); name=InputString(11,30,37,cfgfilename); if(name!=NULL && name[0]!=0) { strcpy(buf,name); ptr=(char *)strchr(buf,'.'); if(ptr!=NULL) strset(ptr,0); strcpy(cfgfilename,buf); strcat(buf,".d32"); n=open(buf,O_RDONLY | O_BINARY); if(n==-1) { envname=getenv("DOS32A"); if(envname!=NULL) { ptr=strchr(envname,' '); if(ptr==NULL) ptr=strchr(envname,0); memset(envbuf,0,256); strncpy(envbuf,envname,(dword)ptr-(dword)envname); strcat(envbuf,"\\D32\\"); strcat(envbuf,buf); n=open(envbuf,O_RDWR | O_BINARY); } } if(n!=-1) { read(n,&id32,24); close(n); SetColor(LIGHTWHITE); SetBackColor(BLUE); strupr(buf); for(n=0; n<13; n++) { SetPos(24,66+n); PrintC(' '); } Print_At(24,66,"%.13s",buf); } else DiskError(); } ValidateConfig(); CloseWindow(); if(mainmenu_sel==1) ShowBannerStatus(); }
void ScrnInit(void) { InitText(); signal(SIGINT, SevereErrorSIGINT); signal(SIGSEGV, SevereErrorSIGSEGV); #ifdef SIGQUIT signal(SIGQUIT, SevereErrorSIGQUIT); #endif LastCheck = StartTime = (long)I_FloatTime(); SetForeColor(ANSI_WHITE); SetBackColor(ANSI_BLUE); DrawFilledBox(0, 0, ScrnWidth, ScrnHeight); StatusLine = 5; MoveCurs(2, 1); SetForeColor(ANSI_WHITE); SetBackColor(ANSI_BLUE); DrawVLine(45, 5, ScrnHeight - 6); DrawHLine(1, 4, ScrnWidth - 2); DrawHLine(1, 2, ScrnWidth - 2); MoveCurs(2, 3); CPrintf("$f3Elapsed time: $f200:00:00 $f7By Lee Smith <[email protected]$f7>$f3"); remove("error.log"); }
void CPrintf(char *format,...) { register char c; register char *ptr, *src; int x, y; char text[1024]; char text2[1024]; va_list v; va_start(v, format); vsprintf(text, format, v); GetCurs(&x, &y); for (ptr = text2, src = text; *src != '\0'; src++) { c = *src; if (c == '$') { switch (*++src) { case '$': *ptr++ = '$'; break; case 'a': *ptr = '\0'; cputs(ptr = text2); RingBell(); break; case 'n': *ptr = '\0'; cputs(ptr = text2); MoveCurs(x, ++y); break; case 'f': *ptr = '\0'; cputs(ptr = text2); SetForeColor(toupper(*++src) - '0'); break; case 'b': *ptr = '\0'; cputs(ptr = text2); SetBackColor(toupper(*++src) - '0'); break; case 'c': *ptr = '\0'; cputs(ptr = text2); SetForeColor(toupper(*++src) - '0'); SetBackColor(toupper(*++src) - '0'); break; } } else if (c >= 32 && c <= 126) *ptr++ = c; } *ptr = '\0'; cputs(ptr = text2); #ifdef UNIX refresh(); #endif }
void ShowModified() { SetColor(LIGHTBLUE); SetBackColor(BLUE); if(CheckIfModified()==TRUE) Print_At(24,0,"*"); else Print_At(24,0," "); }
void JXMesaCamera::Render() { if (!PrepareMesa()) { return; } // erase everything SetBackColor(itsWidget->GetBackColor()); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // prepare the display PrepareTransforms(); // render the scene GetUniverse()->RenderAll(*this); // display the scene glFlush(); if (itsDoubleBufferFlag) { XMesaCopySubBuffer(itsXMBuffer, itsGLViewport.x,itsGLViewport.y, itsGLViewport.width,itsGLViewport.height); } }
void JXImageWidget::SetBitmap ( const JConstBitmap& bitmap, const JColorIndex origForeColor, const JColorIndex origBackColor ) { const JColorIndex foreColor = (origForeColor == kJXTransparentColor ? (GetColormap())->GetBlackColor() : origForeColor); const JColorIndex backColor = (origBackColor == kJXTransparentColor ? (GetColormap())->GetDefaultBackColor() : origBackColor); if (itsOwnsImageFlag) { delete itsImage; } itsImage = new JXImage(GetDisplay(), bitmap, foreColor, backColor); assert( itsImage != NULL ); itsOwnsImageFlag = kJTrue; AdjustBounds(); SetBackColor(backColor); Refresh(); }
void ShowTempEntry(char *format,...) { char text[1024]; va_list v; va_start(v, format); vsprintf(text, format, v); SetBackColor(ANSI_BLUE); if (StatusLine > ScrnHeight - 2) { SetForeColor(ANSI_WHITE); ScrollText(); StatusLine--; } SetForeColor(ANSI_YELLOW); MoveCurs(4, StatusLine); CPrintf("%s", text); StatusLine++; TimeUpdate(); }
void ShowWarningEntry(char *format,...) { char text[1024]; va_list v; va_start(v, format); vsprintf(text, format, v); SetBackColor(ANSI_BLUE); if (StatusLine > ScrnHeight - 2) { SetForeColor(ANSI_WHITE); ScrollText(); StatusLine--; } SetForeColor(ANSI_RED); MoveCurs(2, StatusLine); CPrintf("$f1*** %s", text); if (logging) { LogFile = fopen("error.log", "a+"); if (LogFile != NULL) CfPrintf(LogFile, "*** %s", text); fclose(LogFile); } StatusLine++; TimeUpdate(); }
void JXImageWidget::SetXPM ( const JXPM& data, const JColorIndex origBackColor ) { const JColorIndex backColor = (origBackColor == kJXTransparentColor ? (GetColormap())->GetDefaultBackColor() : origBackColor); if (itsOwnsImageFlag) { delete itsImage; } itsImage = new JXImage(GetDisplay(), data); assert( itsImage != NULL ); itsOwnsImageFlag = kJTrue; AdjustBounds(); SetBackColor(backColor); Refresh(); }
void JXImageWidget::SetImage ( JXImage* image, const JBoolean widgetOwnsImage, const JColorIndex origBackColor ) { const JColorIndex backColor = (origBackColor == kJXTransparentColor ? (GetColormap())->GetDefaultBackColor() : origBackColor); if (image != itsImage) { if (itsOwnsImageFlag) { delete itsImage; } itsImage = image; AdjustBounds(); Refresh(); } SetBackColor(backColor); itsOwnsImageFlag = widgetOwnsImage; }
void DiskError() { SetColor(LIGHTWHITE); SetBackColor(RED); OpenWindow(10,24,5,32); SetColor(YELLOW); Print_At(11,28,"Error Reading/Writing!"); SetColor(BLUE); SetBackColor(WHITE); SetBlink(ON); Print_At(13,26," Press a key to continue... "); SetBlink(OFF); GetKey(); CloseWindow(); keychar=keycode=0; }
void ShowBannerStatus() { if((id32.dos32a_misc2&0x80)==0) { SetColor(LIGHTWHITE); SetBackColor(BLUE); Print_At(12,10,"10) Show Copyright Banner at Startup .................."); } else { SetColor(WHITE); SetBackColor(BLUE); Print_At(12,10,"10) Show Copyright Banner at Startup .................."); SetColor(LIGHTWHITE); } }
WndForm::WndForm(SingleWindow &_main_window, const TCHAR *Caption, int X, int Y, int Width, int Height, const WindowStyle style): main_window(_main_window), mModalResult(0), mColorTitle(Color::YELLOW), mhTitleFont(&Fonts::MapBold), mOnTimerNotify(NULL), mOnKeyDownNotify(NULL) { set(main_window, X, Y, Width, Height, add_border(style)); // Create ClientWindow SetBackColor(Color(0xDA, 0xDB, 0xAB)); WindowStyle client_style; client_style.control_parent(); client_area.set(*this, mClientRect.left, mClientRect.top, mClientRect.right - mClientRect.left, mClientRect.bottom - mClientRect.top, client_style); client_area.SetBackColor(GetBackColor()); cbTimerID = set_timer(1001, 500); SetCaption(Caption); #if !defined(ENABLE_SDL) && !defined(NDEBUG) ::SetWindowText(hWnd, mCaption); #endif }
PanelControl::PanelControl(ContainerControl &parent, int x, int y, unsigned width, unsigned height, const WindowStyle style) { SetForeColor(parent.GetForeColor()); SetBackColor(parent.GetBackColor()); set(parent.GetClientAreaWindow(), x, y, width, height, style); }
void Console::SetColor(ConsoleColor Text, ConsoleColor Back, bool blink) { //Sets the colour of the text being displayed SetTextColor(Text); SetBackColor(Back); if(blink) { m_Color = (m_backGroundColor << 4) | m_Text | 128; } }
void CRButtonCtrl::DoPropExchange(CPropExchange* pPX) { m_ResourceNumber&=0x00ffffff; m_ResourceNumber+=m_alignment<<24; ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor)); COleControl::DoPropExchange(pPX); PX_Bool(pPX, _T("MovesParent"), m_bMovesParent, FALSE); PX_Long(pPX, _T("FontNum"), m_FontNum, 0); PX_Bool(pPX, _T("CloseButton"), m_bCloseButton, FALSE); PX_Bool(pPX, _T("TickButton"), m_bTickButton, FALSE); PX_Bool(pPX, _T("ShowShadow"), m_bShowShadow, FALSE); PX_Color(pPX, _T("ShadowColor"), m_ShadowColor, FALSE); PX_String(pPX, _T("String"), m_string, _T("")); PX_Long(pPX, _T("ResourceNumber"), m_ResourceNumber, 0); PX_Long(pPX, _T("NormalFileNum"), m_NormalFileNum, 0); PX_Long(pPX, _T("PressedFileNum"), m_PressedFileNum, 7); PX_String(pPX, _T("NormalFileNumString"), m_NormalFileNumString, _T("")); PX_String(pPX, _T("PressedFileNumString"), m_PressedFileNumString, _T("")); if (pPX->GetVersion()&0x1) { PX_String(pPX, _T("HintString"), m_hintString, _T("")); PX_String(pPX, _T("HintStringID"), m_hintStringID, _T("")); PX_Long(pPX, _T("HintResourceNumber"), m_hintResourceNumber, 0); } else { } if (pPX->GetVersion()&0x2) { } else { } m_alignment=m_ResourceNumber>>24; //DeadCode MS 04May100 UByteP(0xB0000)[160*5]='0'+m_alignment; m_ResourceNumber&=0x00ffffff; if (pPX->IsLoading()) { if (GetBackColor()==0) SetBackColor(GetForeColor()); if (m_bCloseButton || m_bTickButton) //JIM 21/05/99 m_bHelpButton=TRUE; // remove this if it becomes a persistent property else m_bHelpButton=FALSE; } if (m_PressedFileNum==7) m_PressedFileNumString=""; }
void CLogSpreadSheet::SetRowColorNotComplete(long nRow) { SetCol(1); SetRow(nRow); SetCol2(10); SetRow2(nRow); SetBlockMode(true); SetBackColor(m_cBackGroundNotComplete); SetBlockMode(false); }
void CheckIfLocked() { if((id32.dos32a_misc2&0x40)==0x40) { SetColor(LIGHTWHITE); SetBackColor(RED); OpenWindow(10,24,5,32); SetColor(YELLOW); Print_At(11,28,"Configuration is Locked!"); SetColor(BLUE); SetBackColor(WHITE); SetBlink(ON); Print_At(13,27," Press any key to exit... "); SetBlink(OFF); GetKey(); CloseAllWindows(); VideoReset(); exit(0); } }
/** \brief Construtor da classe \details Funções executadas neste módulo: - Inicia as variáveis globais desta classe - Cria a fonte a ser utilizada nesta tela - Muda a cor da janela de fundo \param CppSQLite3DB *pDB: Ponteiro para o banco de dados \param LPCTSTR szCodigo: Código do agente \param CWnd* pParent: Ponteiro para a janela que será pai desta */ CIdentificacaoDlg::CIdentificacaoDlg(CppSQLite3DB *pDB, LPCTSTR szCodigo, CWnd* pParent /*=NULL*/) : CDialogEx(CIdentificacaoDlg::IDD, pParent) { m_sAgente = szCodigo; m_pDB = pDB; CUtil::CreateFont(&m_font, L"Verdana", -11, TRUE); // Mudar a cor do fundo... SetBackColor(RGB(173, 199, 222)); }
void CreateConfig() { int n; char *name; char *ptr; char buf[80]; SetColor(LIGHTWHITE); SetBackColor(BLUE); OpenWindow(10,10,3,60); SetColor(YELLOW); Print_At(10,13," Create Predefined Configuration "); SetColor(LIGHTWHITE); Print_At(11,12,"Enter file name:"); name=InputString(11,30,37,cfgfilename); if(name!=NULL && name[0]!=0) { strcpy(buf,name); ptr=(char *)strchr(buf,'.'); if(ptr!=NULL) strset(ptr,0); strcpy(cfgfilename,buf); strcat(buf,".D32"); n=open(buf,O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IRWXU); if(n!=-1) { write(n,&id32,24); close(n); SetColor(LIGHTWHITE); SetBackColor(BLUE); strupr(buf); for(n=0; n<13; n++) { SetPos(24,66+n); PrintC(' '); } Print_At(24,66,"%.13s",buf); } else DiskError(); } CloseWindow(); }
WndOwnerDrawFrame::WndOwnerDrawFrame(ContainerControl &parent, int X, int Y, int Width, int Height, const WindowStyle style, OnPaintCallback_t OnPaintCallback) :mOnPaintCallback(OnPaintCallback), mOnMouseDownCallback(NULL) { SetForeColor(parent.GetForeColor()); SetBackColor(parent.GetBackColor()); set(parent.GetClientAreaWindow(), X, Y, Width, Height, style); }
void ShowEnvInfo() { char *str; SetColor(LIGHTWHITE); SetBackColor(WHITE); OpenWindow(14,1,3,76); SetColor(LIGHTGREEN); Print_At(14,4," DOS/32A Environment String "); SetColor(LIGHTWHITE); str=getenv("DOS32A"); if(str==NULL) Print_At(15,3,"(Not Defined)"); else Print_At(15,3,"DOS32A=%.74s",str); }
TButton::TButton(TWindow* parent, const TRect& bounds, const TChar* title, TCommandID commandID, bool dismissesDialog) : TWindow(parent, bounds, kChildWindow), fTitle(title), fCommandID(commandID), fDismissesDialog(dismissesDialog), fPressed(false), fEnabled(true), fDefault(false), fTrackingMouse(false) { SetBackColor(kLightGrayColor); }
CNFORenderer::CNFORenderer(bool a_classicMode) : m_classic(a_classicMode), m_partial(NRP_RENDER_EVERYTHING), m_forceGPUOff(false), m_allowCPUFallback(true), m_onDemandRendering(false), m_preRenderThread(NULL), m_gridData(NULL), m_rendered(false), m_linesPerStripe(0), m_stripeHeight(0), m_numStripes(0), m_fontSize(-1), m_zoomFactor(1.0f), m_hasBlocks(false), m_stopPreRendering(true), m_preRenderingStripe((size_t)-1), m_cancelRenderingImmediately(false) { // default settings: SetFontAntiAlias(true); SetBackColor(_S_COLOR_RGB(0xFF, 0xFF, 0xFF)); SetTextColor(_S_COLOR_RGB(0, 0, 0)); SetArtColor(_S_COLOR_RGB(0, 0, 0)); SetHilightHyperLinks(true); SetHyperLinkColor(_S_COLOR_RGB(0, 0, 0xFF)); SetUnderlineHyperLinks(true); if(!m_classic) { SetBlockSize(7, 12); m_settings.uFontSize = 0; SetEnableGaussShadow(true); SetGaussColor(_S_COLOR_RGB(128, 128, 128)); SetGaussBlurRadius(15); m_padding = 8; } else { SetFontSize(ms_defaultClassicFontSize); m_settings.uBlockHeight = m_settings.uBlockWidth = 0; m_settings.uGaussBlurRadius = 0; SetEnableGaussShadow(false); m_padding = 5; } }
CMLineIndexTable::CMLineIndexTable ( JOrderedSetT::CompareResult (*bpCcompareFn)(CMBreakpoint *const &, CMBreakpoint *const &), CMSourceDirector* dir, CMSourceText* text, JXScrollbarSet* scrollbarSet, JXContainer* enclosure, const HSizingOption hSizing, const VSizingOption vSizing, const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h ) : JXTable(1, 1, NULL, enclosure, hSizing, vSizing, x, y, w, h), itsDirector(dir), itsText(text), itsVScrollbar(scrollbarSet->GetVScrollbar()), itsCurrentLineIndex(0), itsLineMenu(NULL), itsDeselectTask(NULL) { itsLink = CMGetLink(); ListenTo(itsLink); itsBPList = jnew JPtrArray<CMBreakpoint>(JPtrArrayT::kForgetAll); assert(itsBPList != NULL); itsBPList->SetCompareFunction(bpCcompareFn); itsBPList->SetSortOrder(JOrderedSetT::kSortAscending); WantInput(kJFalse); SetBackColor(CMGetPrefsManager()->GetColor(CMPrefsManager::kBackColorIndex)); SetFocusColor(GetBackColor()); SetRowBorderInfo(0, GetBackColor()); SetColBorderInfo(0, GetBackColor()); SetDrawOrder(kDrawByCol); AppendCols(3); CMAdjustLineTableToTextTask* task = jnew CMAdjustLineTableToTextTask(this); assert( task != NULL ); task->Go(); ListenTo(itsText); ListenTo(itsVScrollbar); ListenTo(itsLink->GetBreakpointManager()); }
void CheckVersion() { if(id32.dos32a_version==0) return; if(id32.dos32a_version!=version2) { SetColor(LIGHTWHITE); SetBackColor(RED); OpenWindow(10,18,8,44); SetColor(LIGHTWHITE); Print_At(11,20,"WARNING:"); SetColor(YELLOW); Print_At(11,29,"DOS Extender's version does not"); Print_At(12,20,"match the version of the Setup Program!!"); SetColor(BLUE); SetBackColor(WHITE); SetBlink(ON); Print_At(15,27," Press any key to exit... "); SetBlink(OFF); GetKey(); CloseWindow(); DiscardExit(); } }
JXScrolltab::JXScrolltab ( JXScrollbar* scrollbar, const JCoordinate value ) : JXWidget(scrollbar, kFixedLeft, kFixedTop, -20,0, 10,10), itsScrollbar(scrollbar), itsValue(value), itsActionMenu(NULL) { SetBackColor((GetColormap())->GetBlueColor()); itsScrollbar->ScrolltabCreated(this); UpdatePosition(); }
void ShowHelp(int menu, int header) { char c; SetColor(LIGHTWHITE); SetBackColor(GREEN); DrawWindow(18,1,5,76); SetColor(LIGHTGREEN); Print_At(18,4," Quick Help "); SetColor(LIGHTWHITE); SetPos(19,3); if(menu==0) PrintHelp(mainhlp[header]); if(menu==1) PrintHelp(kernelhlp[header]); if(menu==2) PrintHelp(extenderhlp[header]); }
JXRowHeaderWidget::JXRowHeaderWidget ( JXTable* table, JXScrollbarSet* scrollbarSet, JXContainer* enclosure, const HSizingOption hSizing, const VSizingOption vSizing, const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h ) : JXEditTable(1,w, NULL, enclosure, hSizing,vSizing, x,y, w,h) { assert( table != NULL && scrollbarSet != NULL ); itsTable = table; itsTable->SetRowHeader(this); ListenTo(itsTable); itsVScrollbar = scrollbarSet->GetVScrollbar(); ListenTo(itsVScrollbar); itsTitles = NULL; itsAllowRowResizingFlag = kJFalse; itsMinRowHeight = 1; itsHMarginWidth = 2*kCellFrameWidth; itsMaxBcastWidth = 0; itsDragType = kInvalidDrag; itsDragLineCursor = JXGetDragHorizLineCursor(GetDisplay()); itsDragAllLineCursor = JXGetDragAllHorizLineCursor(GetDisplay()); SetColBorderInfo(0, (GetColormap())->GetBlackColor()); // override JXEditTable WantInput(kJFalse); SetBackColor((GetColormap())->GetDefaultBackColor()); AppendCols(1, GetApertureWidth()); AdjustToTable(); }