// create a new paint brush void TOleDocWindow::CMPBrush( RTMessage ) { BackupObject(); bObjectLoaded = FALSE; lstrcpy( lpszObjectName, GetNextObjectName() ); ret = OleCreate( "StdFileEditing", (LPOLECLIENT)pOwlClient, "PBRUSH", lhClientDoc, GetApplication()->Name, &lpObject, olerender_draw, 0 ); // Creating an Ole Object is a asynchronous operation. An // interesting experiment is to use TDW to step into // WaitOleNotBusy (which the following wait macro takes you // to) and look at the user screen between message // dispatching. You should see pbrush gradually paint // itself as it processes the messages which which Ole // generates for it. In general, if a Ole Server does not // behave properly when creating an object, a likely cause is a // problem with the message dispatch loop. wait( ret , lpObject ); // OleSetHostNames sets the name in the server app. If this // was not called, pbrush would display a string with a bunch // of % sings in it. ret = OleSetHostNames( lpObject, GetApplication()->Name, lpszObjectName ); wait( ret , lpObject ); }
void GuiControl::CloseTooltip() { if(GetApplication()->GetTooltipOwner()==this) { GetApplication()->CloseTooltip(); } }
BOOL ColourDragInformation::Init() { // Setup preference for drag transparency if (GetApplication()->DeclareSection(_T("Dragging"), 1)) GetApplication()->DeclarePref( NULL, _T("ColourDragTransparency"), &DragTransparency, 0, 100); return TRUE; }
BOOL ClickModifiers::DeclarePrefs() { GetApplication()->DeclareSection( wxT("Mouse"), 5); GetApplication()->DeclarePref( wxT("Mouse"), wxT("Left Button"), (INT32*)&LeftButtonFunction); GetApplication()->DeclarePref( wxT("Mouse"), wxT("Middle Button"), (INT32*)&MiddleButtonFunction); GetApplication()->DeclarePref( wxT("Mouse"), wxT("Right Button"), (INT32*)&RightButtonFunction); return TRUE; }
void run_chain(int nChainNumber) { int inst = inst_ok(INST_LOC_CHAINS, nChainNumber + 1); if (inst != 0) { char szMessage[255]; sprintf(szMessage, "|#2Chain %s is in use on instance %d", chains[nChainNumber].description, inst); if (!(chains[nChainNumber].ansir & ansir_multi_user)) { strcat(szMessage, "Try again later.\r\n"); GetSession()->bout << szMessage; return; } else { strcat(szMessage, "Care to join in? "); GetSession()->bout << szMessage; if (!yesno()) { return; } } } write_inst(INST_LOC_CHAINS, static_cast< unsigned short >(nChainNumber + 1), INST_FLAGS_NONE); if (GetApplication()->HasConfigFlag(OP_FLAGS_CHAIN_REG) && chains_reg) { chains_reg[nChainNumber].usage++; WFile regFile(syscfg.datadir, CHAINS_REG); if (regFile.Open(WFile::modeReadWrite | WFile::modeBinary | WFile::modeCreateFile | WFile::modeTruncate, WFile::shareUnknown, WFile::permReadWrite)) { regFile.Write(chains_reg, GetSession()->GetNumberOfChains() * sizeof(chainregrec)); } } char szComSpeed[ 11 ]; sprintf(szComSpeed, "%d", (com_speed == 1) ? 115200 : com_speed); char szComPortNum[ 11 ]; sprintf(szComPortNum, "%d", syscfgovr.primaryport); char szModemSpeed[ 11 ]; sprintf(szModemSpeed, "%d", modem_speed); const std::string chainCmdLine = stuff_in(chains[nChainNumber].filename, create_chain_file(), szComSpeed, szComPortNum, szModemSpeed, ""); sysoplogf("!Ran \"%s\"", chains[nChainNumber].description); GetSession()->GetCurrentUser()->SetNumChainsRun(GetSession()->GetCurrentUser()->GetNumChainsRun() + 1); unsigned short flags = 0; if (!(chains[nChainNumber].ansir & ansir_no_DOS)) { flags |= EFLAG_COMIO; } if (chains[nChainNumber].ansir & ansir_no_pause) { flags |= EFLAG_NOPAUSE; } if (chains[nChainNumber].ansir & ansir_emulate_fossil) { flags |= EFLAG_FOSSIL; } ExecuteExternalProgram(chainCmdLine, flags); write_inst(INST_LOC_CHAINS, 0, INST_FLAGS_NONE); GetApplication()->UpdateTopScreen(); }
void WidgetsInterfaceKit::OnWtRatiometricStateChanged(Wt::WCheckBox* checkbox) { bool ratiometric = checkbox->isChecked(); CPhidgetInterfaceKit_setRatiometric(m_phidget->GetNativeHandle(), ratiometric ? PTRUE : PFALSE); ::GetApplicationManager()->OnWtRatiometricChanged(GetApplication(), GetSerial(), ratiometric); UpdateSensorFunctionDropdowns(ratiometric); GetApplication()->triggerUpdate(); }
void RTSPProtocol::GetStats(Variant &info, uint32_t namespaceId) { BaseProtocol::GetStats(info, namespaceId); info["streams"].IsArray(true); Variant si; if (GetApplication() != NULL) { StreamsManager *pStreamsManager = GetApplication()->GetStreamsManager(); map<uint32_t, BaseStream*> streams = pStreamsManager->FindByProtocolId(GetId()); FOR_MAP(streams, uint32_t, BaseStream *, i) { si.Reset(); MAP_VAL(i)->GetStats(si, namespaceId); info["streams"].PushToArray(si); }
void SelectionState::DeselectAll(BOOL RenderBlobs) { // Find the selected objects in the tree; SelRange* Selected = GetApplication()->FindSelection(); ERROR3IF( Selected==NULL, "Selection object is null in DeselectAll()"); // Get the selected spread Spread* pSpread = Document::GetSelectedSpread(); ERROR3IF(pSpread == NULL,"NULL selected spread"); // Make sure that we have a spread and a selection if (pSpread == NULL || Selected == NULL) return; // Find first selected node #if !defined(EXCLUDE_FROM_RALPH) Node* pFirstSelectedNode = Selected->FindFirst(); // If there is a selection, EOR blobs off, deselect nodes, and inform everybody if (pFirstSelectedNode != NULL && RenderBlobs) { // Go though and render all the EOR blobs off the screen // Find the Blob Manager BlobManager* BlobMgr = GetApplication()->GetBlobManager(); ENSURE( BlobMgr!=NULL, "Blob Manager unexpectedly not there."); // Render all the blobs BlobMgr->RenderOff(NULL, pFirstSelectedNode->FindParentSpread()); Tool* pTool = Tool::GetCurrent(); // Get the tool to remove all its blobs before we deselect the nodes. // Only do this if the current tool dosent update itself on sel changed messages if (pSpread!=NULL && pTool!=NULL && !pTool->AreToolBlobsRenderedOnSelection()) pTool->RenderToolBlobs(pSpread,NULL); } #endif DeselectAll(pSpread->FindFirstChild()); // Selection cache is no longer valid, so update and tell everyone that it has changed // *Note*, This used to be 'Selected->Update(TRUE)', but I (Will) removed the TRUE, so // that a message is NOT broadcast. This should only be called from an operation, // and the op will send a message when it ends. Selected->Update(); }
/* Initialize the bitblt demo window and allocate bitmaps */ TBitBltWindow::TBitBltWindow( PTWindowsObject AParent, LPSTR ATitle ) : TBaseDemoWindow( AParent, ATitle ) { Background = LoadBitmap(GetApplication()->hInstance, MAKEINTRESOURCE(BackgroundID)); Ship = LoadBitmap(GetApplication()->hInstance, MAKEINTRESOURCE(ShipID)); MonoShip = LoadBitmap(GetApplication()->hInstance, MAKEINTRESOURCE(MonoShipID)); ScratchBitmap = 0; StretchedBkgnd = 0; OldX = 0; OldY = 0; X = 0; Y = 0; Delta = 5; CurClick = 1; };
void LiveEffectsTool::OnMouseMove(DocCoord Coord, Spread* pSpread, ClickModifiers mods) { // Stub out this function if the tool isn't wanted #ifndef NO_ADVANCED_TOOLS // We are interested in any selected paths that the cursor is over // we will also be needing the current docview SelRange* Selected = GetApplication()->FindSelection(); Node* pNode = Selected->FindFirst(); // Check to see if the selection is on the same spread as the mouse if (pNode!=NULL) { // Get the spread and return if it is different from the one with the cursor Spread* pNodeSpread = pNode->FindParentSpread(); if (pNodeSpread!=pSpread) return; } // Find the Blob manager, so we can find out how big a rect to use BlobManager* pBlobMgr = GetApplication()->GetBlobManager(); if (pBlobMgr==NULL) return; // Find the Rect round the mouse pos that counts as a hit DocRect BlobRect; pBlobMgr->GetBlobRect(Coord, &BlobRect); // Work out the square of the distance that we will count as 'close' to the line INT32 Range = BlobRect.Width() / 2; Range *= Range; // // loop through the selection // while (pNode!=NULL) // { // // Now find the next selected node // pNode = Selected->FindNext(pNode); // } // We did not find anything good, so set the cursor to the normal one ChangeCursor(pNormalCursor); // And set the status bar text StatusMsg.Load(_R(IDS_LIVEEFFECTSTART), Tool::GetModuleID(GetID())); GetApplication()->UpdateStatusBarText(&StatusMsg); #endif // NO_ADVANCED_TOOLS }
/******************************************************************************************** > static OpState OpRemoveClipView::GetState(String_256* pstrDescription, OpDescriptor* pOpDesc) Author: Karim_MacDonald (Xara Group Ltd) <*****@*****.**> Created: 01 February 2000 Inputs: pstrDescription pOpDesc Outputs: Returns: Purpose: Errors: See also: ********************************************************************************************/ OpState OpRemoveClipView::GetState(String_256* pstrDescription, OpDescriptor* pOpDesc) { // default is an unticked, ungreyed, *NOT* on-menu state. OpState OpSt; OpSt.RemoveFromMenu = TRUE; // obtain the app's current selection. // we want to treat bevels/contours etc. as atomic objects. Range Sel(*(GetApplication()->FindSelection())); RangeControl rc = Sel.GetRangeControlFlags(); rc.PromoteToParent = TRUE; Sel.Range::SetRangeControl(rc); // we only show ourself if the selection consists of one lone NodeClipViewController. Node* pNode = Sel.FindFirst(); if (pNode != NULL && pNode->IsANodeClipViewController()) { if (Sel.FindNext(pNode) == NULL) { OpSt.RemoveFromMenu = FALSE; // if it's selected inside, we gray ourself and give a reason. if (Sel.ContainsSelectInside()) { OpSt.Greyed = TRUE; *pstrDescription = String_256(_R(IDS_GREY_WHEN_SELECT_INSIDE)); } } } return OpSt; }
BOOL NodeSimpleShape::IsNearControlHandle(DocCoord Coord, INT32* CoordNum) { #if !defined(EXCLUDE_FROM_RALPH) // Find the blob manager BlobManager* pBlobMgr = GetApplication()->GetBlobManager(); if (pBlobMgr==NULL) return FALSE; // Find out about the size of a blob DocRect BlobRect; pBlobMgr->GetBlobRect(Coord, &BlobRect); // Check to see if it is near any of the blobs for (INT32 i=0; i<4; i++) { // Check for collision with the control points if (BlobRect.ContainsCoord(Parallel[i])) { // Tell them which control point it waas over *CoordNum = i; // we have used that click up, so tell the world return TRUE; } } #endif // was not over any of the control points return FALSE; }
BOOL NodeSimpleShape::OnClick( DocCoord PointerPos, ClickType Click, ClickModifiers ClickMods, Spread* pSpread ) { PORTNOTETRACE("other","NodeSimpleShape::OnClick - do nothing"); #if !defined(EXCLUDE_FROM_RALPH) // we only handle the click if we can confirm that object blobs are being displayed. BlobManager* pBlobMgr = GetApplication()->GetBlobManager(); if (pBlobMgr == NULL) return FALSE; if (!pBlobMgr->GetCurrentInterest().Object) return FALSE; INT32 ClickCorner; if (IsNearControlHandle(PointerPos, &ClickCorner)) { // The click was over a control point, so start the drag and tell it the opposite corner if (Click==CLICKTYPE_DRAG) HandleBlobDrag(Parallel[ClickCorner], pSpread, (ClickCorner+2)%4 ); // we have used that click up, so tell the world return TRUE; } #endif // did not use the click return FALSE; }
_declspec(nothrow) void ExcelControllerImpl08::SetScreenUpdating(bool bEnabled) { try { if(IsResponding()) { Excel::_ApplicationPtr spApplication = GetApplication(); if (spApplication == 0) return; LCID lcid; if (spApplication->ActiveWorkbook != 0) lcid = LocaleHelper::GetLocaleIDForInstalledExcel(spApplication->ActiveWorkbook); else lcid = LocaleHelper::GetLocaleIDForInstalledExcel(spApplication); spApplication->ScreenUpdating[lcid] = bEnabled ? VARIANT_TRUE : VARIANT_FALSE; } } catch(const Workshare::Exception&) { //ignore } catch(...) { ProcessUnhandledException(); } }
void TSysInfoWindow::GetSysInformation( void ) { DWORD SysFlags; char tempstr[ 31 ]; WORD ArgList[ 2 ]; WORD Ver; DWORD Available; HINSTANCE hInstance = GetApplication()->hInstance; SysFlags = GetWinFlags(); ArgList[ 0 ] = GetModuleUsage( hInstance ); wvsprintf( (LPSTR) TransferRecord.InstanceNumber, (LPSTR) "%d", (LPSTR) ArgList ); Ver = GetVersion(); ArgList[0] = (WORD) LOBYTE(LOWORD( Ver )); ArgList[1] = (WORD) HIBYTE(LOWORD( Ver )); wvsprintf( (LPSTR) TransferRecord.WindowsVersion, (LPSTR) "%d.%d", (LPSTR) ArgList ); if ( SysFlags & WF_ENHANCED ) LoadString( hInstance, ID_ENHANCED, tempstr, sizeof( tempstr ) ); else if ( SysFlags & WF_STANDARD ) LoadString( hInstance, ID_STANDARD, tempstr, sizeof( tempstr ) ); else if ( SysFlags & WF_PMODE ) LoadString( hInstance, ID_REAL, tempstr, sizeof( tempstr ) ); else LoadString( hInstance, ID_UNKNOWN, tempstr, sizeof( tempstr ) ); strcpy( TransferRecord.OperationMode, tempstr ); if ( SysFlags & WF_CPU086 ) LoadString( hInstance, ID_CPU8086, tempstr, sizeof( tempstr ) ); else if ( SysFlags & WF_CPU186 ) LoadString( hInstance, ID_CPU80186, tempstr, sizeof( tempstr ) ); else if ( SysFlags & WF_CPU286 ) LoadString( hInstance, ID_CPU80286, tempstr, sizeof( tempstr ) ); else if ( SysFlags & WF_CPU386 ) LoadString( hInstance, ID_CPU80386, tempstr, sizeof( tempstr ) ); else if ( SysFlags & WF_CPU486 ) LoadString( hInstance, ID_CPU80486, tempstr, sizeof( tempstr ) ); else LoadString( hInstance, ID_UNKNOWN, tempstr, sizeof( tempstr ) ); strcpy( TransferRecord.CPUType, tempstr ); if ( SysFlags & WF_80x87 ) LoadString( hInstance, ID_YES, tempstr, sizeof( tempstr ) ); else LoadString( hInstance, ID_NO, tempstr, sizeof( tempstr ) ); strcpy( TransferRecord.CoProcessor, tempstr ); Available = GetFreeSpace( 0 ) / 1024; ArgList[0] = LOWORD( Available ); ArgList[1] = HIWORD( Available ); wvsprintf( (LPSTR) TransferRecord.Global, (LPSTR) "%lu", (LPSTR) ArgList ); ArgList[0] = _osmajor; ArgList[1] = _osminor; wvsprintf( (LPSTR) TransferRecord.VersionDos, (LPSTR) "%d.%d", (LPSTR) ArgList ); TransferBuffer = (LPSTR) &TransferRecord; }
void CIECoreView::NavigateComplete2(LPDISPATCH pDisp, VARIANT* URL) { if(pDisp == GetApplication() /* 仅处理最顶层Frame的事件 */) { if(m_bFixed == FALSE) { m_bFixed = TRUE; HWND hEmbed=NULL; HWND hDoc=NULL; if(m_hWnd) { hEmbed=::FindWindowExW(m_hWnd,NULL,TEXT("Shell Embedding"),NULL); if(hEmbed!=NULL) { hDoc=::FindWindowExW(hEmbed,NULL,TEXT("Shell DocObject View"),NULL); if(hDoc!=NULL) { m_hIEServerWnd=::FindWindowExW(hDoc,NULL,TEXT("Internet Explorer_Server"),NULL); } } } if(m_hIEServerWnd!=NULL ) { //m_wndFixer.SubclassWindow(m_hIEServerWnd); } } } }
void PlugInOp::Do(OpDescriptor* pOpDesc) { if (pOpDesc == NULL) { ERROR3IF(pOpDesc == NULL,"PlugInOp::Do null OpDescriptor"); return; } //ERROR3("PlugInOp - do"); // Search the plug-ins list for the specified plug-in and invoke it PlugInManager* pManager = GetApplication()->GetPlugInManager(); if (pManager == NULL) return; PlugInItem * pPlugIn = pManager->GetFirstPlugIn(); String_32 OpToken; while (pPlugIn) { OpToken = pPlugIn->GetUniqueID(); OpToken += pPlugIn->GetPlugInName(); if (pOpDesc->Token == OpToken) pPlugIn->About(); pPlugIn = pManager->GetNextPlugIn(pPlugIn); } // and finish End(); }
void CIECoreView::DocumentComplete(LPDISPATCH pDisp, VARIANT* URL) { if (GetApplication() == pDisp) { OnMainDocumentComplete(pDisp,URL); } }
BaseProtocol *InboundHTTP4RTMP::Bind(string sid) { BaseProtocol *pResult = NULL; if (_pNearProtocol == NULL) { //14. This might be a new connection. Do we have that sid generated? if (!MAP_HAS1(_generatedSids, sid)) { FATAL("Invalid sid: %s", STR(sid)); return false; } //15. See if we have to generate a new connection or we just pick up //a disconnected one if (MAP_HAS1(_protocolsBySid, sid)) { pResult = ProtocolManager::GetProtocol(_protocolsBySid[sid]); } else { pResult = new InboundRTMPProtocol(); pResult->Initialize(GetCustomParameters()); pResult->SetApplication(GetApplication()); _protocolsBySid[sid] = pResult->GetId(); SetNearProtocol(pResult); pResult->SetFarProtocol(this); } } else { pResult = _pNearProtocol; } return pResult; }
void NodeBrush::RenderObjectBlobs(RenderRegion* pRegion) { #if !defined(EXCLUDE_FROM_RALPH) // Find out about the groups bounding rect DocRect BoundingRect = GetBoundingRect(); // Inflate the bounds by the width of a blob DocRect TempRect; GetApplication()->GetBlobManager()->GetBlobRect(BoundingRect.lo,&TempRect); INT32 Delta = ((TempRect.hi.x - TempRect.lo.x)*3)/4; BoundingRect.Inflate(Delta); // Find out where to draw the blobs DocCoord Low = BoundingRect.LowCorner(); DocCoord High = BoundingRect.HighCorner(); // Set the colours of the blobs pRegion->SetFillColour(COLOUR_UNSELECTEDBLOB); pRegion->SetLineColour(COLOUR_NONE); // Draw all the blobs pRegion->DrawBlob(Low, BT_UNSELECTED); pRegion->DrawBlob(High, BT_UNSELECTED); pRegion->DrawBlob(DocCoord(Low.x, High.y), BT_UNSELECTED); pRegion->DrawBlob(DocCoord(High.x, Low.y), BT_UNSELECTED); // for some reason the NBP is never called, there is probably a // proper fix for this but I don't have time right now, so render // the nodeblend path here m_pNodeBrushPath->RenderObjectBlobs(pRegion); #endif }
void CSXSView::DocumentComplete(LPDISPATCH pDisp, VARIANT* URL) { if ( GetApplication() == pDisp ) { CString strUrl; strUrl = URL->bstrVal; if ( strUrl.CompareNoCase(L"http://www.130100.prcjx.cn/") == 0 ) { SetTimer(TIME_ID_INPUT_LOGIN,2000,NULL); g_loger.StatusOut(L"打开首页"); } else if( strUrl.CompareNoCase(L"http://www.130100.prcjx.cn:800/admin/std") == 0 ) { SetTimer(TIME_ID_QUERY_USER_INFO,2000,NULL); SetTimer(TIME_ID_CLICK_WATCH_CONTINE,4000,NULL); g_loger.StatusOut(L"打开用户首页"); } if ( strUrl.Find(L"http://www.130100.prcjx.cn:800/admin/std/training") >= 0 ) { SetTimer( TIME_ID_MOUSE_MOVE , 5000,NULL); SetTimer( TIME_ID_CHECK_VIDEO_PAUSE , 5000 , NULL ); g_loger.StatusOut(L"打开视频教程"); } else { KillTimer(TIME_ID_MOUSE_MOVE); } } }
static Bool _ExecuteProcess(MessageHandler *handler, ProcessNode *node) { int (*apl)(char *, char *, char *, char *); char *module; long start, end; Bool rc; module = ValueStringPointer(GetItemLongName(node->mcprec->value, "dc.module")); if ((apl = cob_resolve(module)) != NULL) { PutApplication(node); start = GetNowTime(); (void)apl(McpData, SpaData, LinkData, ScrData); end = GetNowTime(); TimerPrintf(start, end, "OpenCOBOL %s:%s:%s\n", module, node->widget, node->event); GetApplication(node); if (ValueInteger(GetItemLongName(node->mcprec->value, "rc")) < 0) { rc = FALSE; } else { rc = TRUE; } } else { Warning("%s - %s is not found.", cob_resolve_error(), module); rc = FALSE; } return (rc); }
/******************************************************************************************** > OpState OpBaseConvertPathSegment::BaseGetState(INT32 PathType) Author: Peter_Arnold (Xara Group Ltd) <*****@*****.**> Created: 16/8/95 Inputs: Type of the path that ends a segment Returns: The tick/grey state of OpBaseConvertPathSegment and derived classes Purpose: For finding the state of this op SeeAlso: OpState ********************************************************************************************/ OpState OpBaseConvertPathSegment::BaseGetState(INT32 PathType) { OpState OpSt; #ifndef STANDALONE SelRange* Selected = GetApplication()->FindSelection(); if ((Document::GetSelected() == NULL) || (Selected == NULL) ) { // There is no selected document or selrange is invalid OpSt.Greyed = TRUE; return OpSt; } Node* pNode = Selected->FindFirst(); BOOL FoundSegment = FALSE; BOOL AllConverted = TRUE; BOOL PrevSelected = FALSE; while ((pNode != NULL) && AllConverted) { if (pNode->IsNodePath() && ((NodePath*)pNode)->IsPathAllowable()) { Path* ThisPath = &(((NodePath*)pNode)->InkPath); PathFlags* Flags = ThisPath->GetFlagArray(); PathVerb* Verbs = ThisPath->GetVerbArray(); INT32 UsedSlots = ThisPath->GetNumCoords(); PrevSelected = FALSE; for (INT32 i=0; i<UsedSlots; i++) { if (Flags[i].IsEndPoint) { if (Flags[i].IsSelected) { if (PrevSelected && ((Verbs[i] & ~PT_CLOSEFIGURE) != PT_MOVETO) ) { FoundSegment = TRUE; if ((Verbs[i] & ~PT_CLOSEFIGURE) != PathType) AllConverted = FALSE; } PrevSelected = TRUE; } else { PrevSelected = FALSE; } } } } pNode = Selected->FindNext(pNode); } OpSt.Greyed = !FoundSegment; OpSt.Ticked = AllConverted && FoundSegment; #endif // #ifdef STANDALONE return OpSt; }
/** * Reads the auto message */ void read_automessage() { GetSession()->bout.NewLine(); std::unique_ptr<WStatus> status(GetApplication()->GetStatusManager()->GetStatus()); bool bAutoMessageAnonymous = status->IsAutoMessageAnonymous(); WTextFile autoMessageFile(syscfg.gfilesdir, AUTO_MSG, "rt"); std::string line; if (!autoMessageFile.IsOpen() || !autoMessageFile.ReadLine(&line)) { GetSession()->bout << "|#3No auto-message.\r\n"; GetSession()->bout.NewLine(); return; } std::string authorName = StringTrimEnd(line); if (bAutoMessageAnonymous) { if (getslrec(GetSession()->GetEffectiveSl()).ability & ability_read_post_anony) { std::stringstream ss; ss << "<<< " << line << " >>>"; authorName = ss.str(); } else { authorName = ">UNKNOWN<"; } } GetSession()->bout << "\r\n|#9Auto message by: |#2" << authorName << "|#0\r\n\n"; int nLineNumber = 0; while (autoMessageFile.ReadLine(&line) && nLineNumber++ < 10) { StringTrim(line); GetSession()->bout.Color(9); GetSession()->bout << "|#9" << line << wwiv::endl; } GetSession()->bout.NewLine(); }
///////////////////////////////////////////////////////////////// // TMainClient // ----------- // void TMainClient::CmFileOpenWad () { // save current working directory (of windeu32.exe) // the TFileOpenDialog below is going to set // it to the folder of the file being opened... char workdir[256]; GetCurrentDirectory(256, workdir); SET_HELP_CONTEXT(Open_WAD_file); // // Display standard Open dialog box to select a file name. // *FileData.FileName = 0; if (TFileOpenDialog(this, FileData).Execute() == IDOK) { // restore workingdirectory to folder of windeu32.exe SetCurrentDirectory(workdir); #if 0 OpenPatchWad(FileData.FileName); CloseUnusedWadFiles(); #endif // Sets a new client window (the editor) and destroy // the old one (the main client) TMainFrame *MainFrame = TYPESAFE_DOWNCAST (GetApplication()->GetMainWindow(), TMainFrame); MainFrame->EditLevel (FileData.FileName, FALSE) ; } RESTORE_HELP_CONTEXT(); }
void TFuncSpecView::SetupWindow() { TWindowView::SetupWindow(); // INSERT>> Your code here. register TImageList* img = ((TSwitchMinApp*) GetApplication())->imglFnSpec; wTabs->SetImageList(*img); // Description wDesc=new TEdit(this, IDC_DESC, swdoc->GetSystem()->desc.c_str(), 0, 0, 0, 0, DESC_SIZE, true); // Options wGeneral=new TFuncSpecGenDialog(this); // Outputs wFuncs=new TFuncSpecFuncsDialog(this); // Inputs wInputs=new TInputsDialog(this); pInputData=new TInputsDialogXfer; wInputs->SetTransferBuffer(pInputData); wTabs->AddPage(wDesc, "Description",0); wTabs->AddPage(wInputs, "Inputs",1); wTabs->AddPage(wFuncs, "Outputs",2); wTabs->AddPage(wGeneral, "Options",3); // Load data into controls VnRevert(true); }
void TOleDocWindow::CMPaste( RTMessage ) { if ( OpenClipboard( HWindow ) ) { BackupObject(); lstrcpy( lpszObjectName, GetNextObjectName() ); ret = OleCreateFromClip( "StdFileEditing", (LPOLECLIENT)pOwlClient, lhClientDoc, lpszObjectName, &lpObject, olerender_draw, 0 ); check( ret ); ret = OleSetHostNames( lpObject, GetApplication()->Name, lpszObjectName ); wait( ret , lpObject ); bObjectLoaded = TRUE; CloseClipboard(); PostMessage( HWindow , WM_U_REDRAW, 0, 0L ); } }
bool InboundRTMPSDiscriminatorProtocol::BindSSL(IOBuffer &buffer) { //1. Create the RTMP protocol BaseProtocol *pRTMP = new InboundRTMPProtocol(); if (!pRTMP->Initialize(GetCustomParameters())) { FATAL("Unable to create RTMP protocol"); pRTMP->EnqueueForDelete(); return false; } //2. Destroy the link BaseProtocol *pFar = _pFarProtocol; pFar->ResetNearProtocol(); ResetFarProtocol(); //3. Create the new links pFar->SetNearProtocol(pRTMP); pRTMP->SetFarProtocol(pFar); //4. Set the application pRTMP->SetApplication(GetApplication()); //5. Enqueue for delete this protocol EnqueueForDelete(); //6. Process the data if (!pRTMP->SignalInputData(buffer)) { FATAL("Unable to process data"); pRTMP->EnqueueForDelete(); } return true; }
void TWorkDialog::Destroy (int retVal) { // Enable main window GetApplication()->GetMainWindow()->EnableWindow(TRUE); TDialog::Destroy(retVal); }
Variant BaseVariantAppProtocolHandler::GetScaffold(string uriString) { //1. Search in the cache first if (_urlCache.HasKey(uriString)) { return _urlCache[uriString]; } //2. Build it Variant result; //3. Split the URL into components URI uri; if (!URI::FromString(uriString, true, uri)) { FATAL("Invalid url: %s", STR(uriString)); return Variant(); } //6. build the end result result["username"] = uri.userName(); result["password"] = uri.password(); result["host"] = uri.host(); result["ip"] = uri.ip(); result["port"] = uri.port(); result["document"] = uri.fullDocumentPath(); result["applicationName"] = GetApplication()->GetName(); //7. Save it in the cache _urlCache[uriString] = result; //8. Done return result; }