BOOL CDownloads_Deleted::Create(CWnd *pParent) { CRect rc (0, 0, 0, 0); if (FALSE == CListCtrlEx::Create (LVS_REPORT|LVS_OWNERDRAWFIXED|LVS_SHOWSELALWAYS, rc, pParent, 0x5A9)) return FALSE; SetExtendedStyle (LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP|LVS_EX_INFOTIP); m_images.Create (16, 17, ILC_COLOR24 | ILC_MASK, 7, 1); CBitmap bmp; bmp.Attach (SBMP (IDB_DOWNLOADSTASKS)); m_images.Add (&bmp, RGB (255, 0, 255)); SetImageList (&m_images, LVSIL_SMALL); m_selimages.Create (16, 17, ILC_COLOR24 | ILC_MASK, 7, 1); CBitmap bmp2; bmp2.Attach (SBMP (IDB_DOWNLOADSTASKS_SEL)); m_selimages.Add (&bmp2, RGB (255, 0, 255)); SetSelectedImages (&m_selimages); InsertColumn (0, "", LVCFMT_LEFT, 200, 0); InsertColumn (1, "", LVCFMT_LEFT, 50, 0); InsertColumn (2, "", LVCFMT_LEFT, 100, 0); InsertColumn (3, "", LVCFMT_LEFT, 58, 0); InsertColumn (4, "", LVCFMT_LEFT, 200, 0); ReadState ("DownloadsDeleted"); return TRUE; }
void CDlgVidMan::CreateBars() { RECT rc = {0, 0, 0, 0}; m_barMan.SetSizes (CSize (23, 23), CSize (16, 16)); m_barMan.CreateEx (this, TBSTYLE_FLAT|TBSTYLE_TRANSPARENT, WS_CHILD | WS_VISIBLE | CCS_NORESIZE | CCS_TOP | CCS_NODIVIDER | CBRS_TOOLTIPS, CRect (0,0,0,0), 0x10ff); m_imgMan.Create (16, 16, ILC_COLOR24 | ILC_MASK, 3, 1); CBitmap bmp; bmp.Attach (SBMP (IDB_VIDMAN)); m_imgMan.Add (&bmp, RGB (255, 0, 255)); m_barMan.GetToolBarCtrl ().SetImageList (&m_imgMan); m_dimgMan.Create (16, 16, ILC_COLOR24 | ILC_MASK, 3, 1); CBitmap bmp1; bmp1.Attach (SBMP (IDB_VIDMAN_D)); m_dimgMan.Add (&bmp1, RGB (255, 0, 255)); m_barMan.GetToolBarCtrl ().SetDisabledImageList (&m_dimgMan); UINT uIDs [] = { ID_DLD_VID_PLAY, ID_DLD_VID_STOP }; m_barMan.SetButtons (uIDs, sizeof (uIDs) / sizeof (UINT)); GetDlgItem (IDC__TOOL)->GetWindowRect (&rc); GetDlgItem (IDC__TOOL)->ShowWindow (SW_HIDE); ScreenToClient (&rc); m_barMan.MoveWindow (rc.left, rc.top, rc.right-rc.left, 25); m_barMute.SetSizes (CSize (23, 23), CSize (16, 16)); m_barMute.CreateEx (this, TBSTYLE_FLAT|TBSTYLE_TRANSPARENT, WS_CHILD | WS_VISIBLE | CCS_NORESIZE | CCS_TOP | CCS_NODIVIDER | CBRS_TOOLTIPS); m_imgMute.Create (16, 16, ILC_COLOR24 | ILC_MASK, 2, 1); CBitmap bmp2; bmp2.Attach (SBMP(IDB_MUTE)); m_imgMute.Add (&bmp2, RGB (255, 0, 255)); m_barMute.GetToolBarCtrl ().SetImageList (&m_imgMute); UINT uID = ID_DLD_VID_MUTE; m_barMute.SetButtons (&uID, 1); GetDlgItem (IDC__MUTE)->GetWindowRect (&rc); GetDlgItem (IDC__MUTE)->ShowWindow (SW_HIDE); ScreenToClient (&rc); m_barMute.MoveWindow (rc.left, rc.top, rc.right-rc.left, 25); }
BOOL CWndLog::Create(CWnd *pParent) { CRect rc (0, 0, 50, 50); if (FALSE == CListCtrl::Create (LVS_REPORT|LVS_NOSORTHEADER|LVS_SHOWSELALWAYS|LVS_OWNERDRAWFIXED, rc, pParent, 0x76329)) return FALSE; SetExtendedStyle (LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP); m_images.Create (16, 15, ILC_COLOR24 | ILC_MASK, 6, 1); CBitmap bmp; bmp.Attach (SBMP (IDB_LOGSTATES)); m_images.Add (&bmp, RGB (255, 0, 255)); SetImageList (&m_images, LVSIL_SMALL); InsertColumn (0, "Time", LVCFMT_LEFT, 80, 0); InsertColumn (1, "Date", LVCFMT_LEFT, 100, 0); InsertColumn (2, "Information", LVCFMT_LEFT, 400, 0); ShowWindow (SW_SHOW); return TRUE; }
BOOL CTorrents_Tasks::Create(CWnd *pwndParent) { CRect rc (0, 0, 50, 50); if (FALSE == CListCtrlEx::Create (HDS_DRAGDROP | LVS_REPORT | LVS_OWNERDRAWFIXED | LVS_SHOWSELALWAYS | LVS_OWNERDATA | LVS_NOSORTHEADER, rc, pwndParent, 0x56783)) return FALSE; SetExtendedStyle (LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP| LVS_EX_INFOTIP|0x00004000); m_images.Create (16, 17, ILC_COLOR24 | ILC_MASK, 7, 1); CBitmap bmp; bmp.Attach (SBMP (IDB_DOWNLOADSTASKS)); m_images.Add (&bmp, RGB (255, 0, 255)); SetImageList (&m_images, LVSIL_SMALL); m_selimages.Create (16, 17, ILC_COLOR24 | ILC_MASK, 7, 1); CBitmap bmp2; bmp2.Attach (SBMP (IDB_DOWNLOADSTASKS_SEL)); m_selimages.Add (&bmp2, RGB (255, 0, 255)); SetSelectedImages (&m_selimages); InsertColumn (0, "", LVCFMT_LEFT, 200, 0); InsertColumn (1, "", LVCFMT_LEFT, 50, 0); InsertColumn (2, "", LVCFMT_LEFT, 100, 0); InsertColumn (3, "", LVCFMT_LEFT, 60, 0); InsertColumn (4, "", LVCFMT_LEFT, 50, 0); InsertColumn (5, "", LVCFMT_LEFT, 58, 0); InsertColumn (6, "", LVCFMT_LEFT, 70, 0); InsertColumn (7, "", LVCFMT_LEFT, 200, 0); InsertColumn (8, "", LVCFMT_LEFT, 120, 0); ReadState ("TorrentsTasks"); ShowWindow (SW_SHOW); return TRUE; }
int CFloatingInfoWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; m_drop.Register (this); CRect rc (0, 0, 50, 50); if (FALSE == m_wndList.Create (LVS_REPORT|LVS_NOCOLUMNHEADER|LVS_OWNERDRAWFIXED, rc, this, 0x76329)) return FALSE; m_imgsList.Create (13, 13, ILC_MASK | ILC_COLOR24, 2, 1); CBitmap bmp; bmp.Attach (SBMP (IDB_DLDSINFO)); m_imgsList.Add (&bmp, RGB (255, 0, 255)); m_wndList.SetImageList (&m_imgsList, LVSIL_SMALL); m_imgsList_sel.Create (13, 13, ILC_MASK | ILC_COLOR24, 2, 1); CBitmap bmp2; bmp2.Attach (SBMP (IDB_DLDSINFO_SEL)); m_imgsList_sel.Add (&bmp2, RGB (255, 0, 255)); m_wndList.SetSelectedImages (&m_imgsList_sel); m_wndList.SetExtendedStyle (LVS_EX_FULLROWSELECT|LVS_EX_INFOTIP); m_wndList.InsertColumn (0, "", LVCFMT_LEFT, 100, 0); m_wndList.InsertColumn (1, "", LVCFMT_RIGHT, 50, 0); m_wndList.InsertColumn (2, "", LVCFMT_RIGHT, 50, 0); m_wndList.Initialize (); m_wndList.ShowWindow (SW_SHOW); m_cxPercent = m_wndList.GetStringWidth ("100%") + 5; m_cxSpeed = m_wndList.GetStringWidth ("9999.9 KB/s") + 5; SetTimer (1, 1000, NULL); SetTimer (2, 500, NULL); return 0; }
BOOL CDownloads_History::Create(CWnd *pParent) { CRect rc (0, 0, 0, 0); m_mgr = &_DldsMgr.m_histmgr; if (FALSE == CListCtrlEx::Create (LVS_REPORT|LVS_OWNERDRAWFIXED|LVS_SHOWSELALWAYS, rc, pParent, 0x5d9)) return FALSE; SetExtendedStyle (LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP|LVS_EX_INFOTIP); m_images.Create (16, 17, ILC_COLOR24 | ILC_MASK, 7, 1); CBitmap bmp; bmp.Attach (SBMP (IDB_DOWNLOADSTASKS)); m_images.Add (&bmp, RGB (255, 0, 255)); SetImageList (&m_images, LVSIL_SMALL); m_selimages.Create (16, 17, ILC_COLOR24 | ILC_MASK, 7, 1); CBitmap bmp2; bmp2.Attach (SBMP (IDB_DOWNLOADSTASKS_SEL)); m_selimages.Add (&bmp2, RGB (255, 0, 255)); SetSelectedImages (&m_selimages); InsertColumn (0, "file", LVCFMT_LEFT, 100, 0); InsertColumn (1, "url", LVCFMT_LEFT, 100, 0); InsertColumn (2, "added", LVCFMT_LEFT, 80, 0); InsertColumn (3, "dlded", LVCFMT_LEFT, 80, 0); InsertColumn (4, "size", LVCFMT_LEFT, 80, 0); InsertColumn (5, "savedto", LVCFMT_LEFT, 100, 0); InsertColumn (6, "comment", LVCFMT_LEFT, 90, 0); ReadState ("DownloadsHistory"); return TRUE; }
BOOL CSitesWnd::Create(CWnd *pWndParent) { CRect rc (0, 0, 50, 50); if (FALSE == CListCtrlEx::Create (LVS_REPORT|LVS_OWNERDRAWFIXED|LVS_NOSORTHEADER|LVS_SHOWSELALWAYS, rc, pWndParent, 0x53459)) return FALSE; SetExtendedStyle (LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP|LVS_EX_INFOTIP); m_images.Create (16, 17, ILC_COLOR24 | ILC_MASK, 4, 1); CBitmap bmp; bmp.Attach (SBMP (IDB_SITELIST)); m_images.Add (&bmp, RGB (255, 0, 255)); SetImageList (&m_images, LVSIL_SMALL); m_selImages.Create (16, 17, ILC_COLOR24 | ILC_MASK, 4, 1); CBitmap bmp1; bmp1.Attach (SBMP (IDB_SITELIST_SEL)); m_selImages.Add (&bmp1, RGB (255, 0, 255)); SetSelectedImages (&m_selImages); InsertColumn (0, LS (L_SITENAME), LVCFMT_LEFT, 200, 0); InsertColumn (1, LS (L_CONNS), LVCFMT_LEFT, 80, 0); InsertColumn (2, LS (L_LOGIN), LVCFMT_LEFT, 100, 0); InsertColumn (3, LS (L_GROUP2), LVCFMT_LEFT, 100, 0); ReadState ("SitesList"); ShowWindow (SW_SHOW); LoadSites (); return TRUE; }
BOOL CSpiderTaskTree::Create(CWnd *pParent) { CRect rc (0, 0, 150, 50); if (FALSE == CTreeCtrl::Create (TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT | TVS_SHOWSELALWAYS, rc, pParent, 0x996)) return FALSE; CBitmap bmpg; bmpg.Attach (SBMP (IDB_DOWNLOADSTASKS)); m_images.Create (16, 17, ILC_COLOR24 | ILC_MASK, 6, 2); m_images.Add (&bmpg, RGB (255, 0, 255)); SetImageList (&m_images, TVSIL_NORMAL); ShowWindow (SW_SHOW); return TRUE; }
HBITMAP vmsUploadsDllCaller::GetBitmap(vmsUploadsDll::vmsWhichBitmap enBmp) { UINT nId = 0; BOOL bCheckAlpha = FALSE; switch (enBmp) { case vmsUploadsDll::BMP_FOR_UPLOADSMENU: bCheckAlpha = _SkinMgr.tbUseAlpha_ForAllPluginMenuImages (); nId = IDB_TOOL_DLD_16; break; case vmsUploadsDll::BMP_FOR_UPLOADSMENU_D: bCheckAlpha = _SkinMgr.tbUseAlpha_ForAllPluginMenuImages (); nId = IDB_TOOL_DLD_16_D; break; case vmsUploadsDll::BMP_FOR_TASKSLIST: nId = IDB_DOWNLOADSTASKS; break; case vmsUploadsDll::BMP_FOR_TASKSLIST_SEL: nId = IDB_DOWNLOADSTASKS_SEL; break; case vmsUploadsDll::BMP_FOR_LOGLIST: nId = IDB_LOGSTATES; break; } HBITMAP hbm = SBMP (nId); if (bCheckAlpha && _TB_USE_ALPHA) { CBitmap bmp; bmp.Attach (hbm); ConvertBmp32WithAlphaToBmp32WithoutAlpha (bmp, GetSysColor (COLOR_MENU)); hbm = (HBITMAP)bmp.Detach (); } return hbm; }
BOOL CDownloads_Groups::Create(CWnd *pParent) { CRect rc (0, 0, 150, 50); if (FALSE == CTreeCtrl::Create (TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT | TVS_SHOWSELALWAYS, rc, pParent, 0x9876)) return FALSE; CBitmap bmpg; bmpg.Attach (SBMP (IDB_GROUPS)); m_images.Create (16, 15, ILC_COLOR24 | ILC_MASK, 8, 2); m_images.Add (&bmpg, RGB (255, 0, 255)); SetImageList (&m_images, TVSIL_NORMAL); m_hAllGroups = InsertItem (TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE | TVIF_TEXT, "", 0, 0, TVIS_BOLD | TVIS_EXPANDED, TVIS_BOLD | TVIS_EXPANDED, 0, TVI_ROOT, TVI_LAST); SetItemData (m_hAllGroups, (ULONG) &m_filterAll); InsertGroups (); InsertFilters (); InsertHistory (); InsertDeleted (); switch (_pwndDownloads->Get_DWWN ()) { case DWWN_LISTOFDOWNLOADS: int nId; nId = _App.View_DownloadsGroups_SelectedFilterId (); switch (nId) { case -2: SelectItem (m_hTasks); break; case -1: SelectItem (m_hAllGroups); break; default: vmsDownloadsGroupSmartPtr pGrp; pGrp = _DldsGrps.FindGroup (nId); if (pGrp != NULL) SetGroupFilter (pGrp); else SelectItem (m_hTasks); break; } break; case DWWN_HISTORY: SelectItem (m_hHistory); Expand (m_hHistory, TVE_EXPAND); break; case DWWN_DELETED: SelectItem (m_hDeleted); break; } m_odmenuImages.Create (16, 15, ILC_COLOR24 | ILC_MASK, 5, 2); CBitmap bmp; bmp.Attach (SBMP (IDB_GROUPSMENU)); m_odmenuImages.Add (&bmp, RGB (255, 0, 255)); CBitmap bmp1; bmp1.Attach (SBMP (IDB_GROUPSMENU_D)); BITMAP bm; bmp1.GetBitmap (&bm); m_odmenuDImages.Create (16, bm.bmHeight, ILC_COLOR24|ILC_MASK, 3, 1); m_odmenuDImages.Add (&bmp1, RGB (255, 0, 255)); m_odmenu.SetImageList (&m_odmenuImages, &m_odmenuDImages); ApplyLanguage (); ShowWindow (SW_SHOW); SetTimer (1, 1000, NULL); return TRUE; }
BOOL fsPluginMgr::LoadBuiltIn() { fsPluginInfo plug; plug.hLib = NULL; m_images.Create (_TB_SIZE_X, _TB_SIZE_Y, ILC_COLOR32 | ILC_MASK, 5, 1); fntGetMainMenu afnGMM [] = { CDownloadsWnd::Plugin_GetMainMenu, CFlashVideoDownloadsWnd::Plugin_GetMainMenu, CTorrentsWnd::Plugin_GetMainMenu, CShedulerWnd::Plugin_GetMainMenu, CHFEWnd::Plugin_GetMainMenu, CSitesWnd::Plugin_GetMainMenu, CSpiderWnd::Plugin_GetMainMenu, }; fntGetViewMenu afnGVM [] = { CDownloadsWnd::Plugin_GetViewMenu, CFlashVideoDownloadsWnd::Plugin_GetViewMenu, CTorrentsWnd::Plugin_GetViewMenu, CShedulerWnd::Plugin_GetViewMenu, CHFEWnd::Plugin_GetViewMenu, CSitesWnd::Plugin_GetViewMenu, CSpiderWnd::Plugin_GetViewMenu, }; const int cPlugins = sizeof (afnGMM) / sizeof (fntGetMainMenu); fntCreateMainWindow afnCMW [] = { CDownloadsWnd::Plugin_CreateMainWindow, CFlashVideoDownloadsWnd::Plugin_CreateMainWindow, CTorrentsWnd::Plugin_CreateMainWindow, CShedulerWnd::Plugin_CreateMainWindow, CHFEWnd::Plugin_CreateMainWindow, CSitesWnd::Plugin_CreateMainWindow, CSpiderWnd::Plugin_CreateMainWindow }; fntGetPluginNames afnGPN [] = { CDownloadsWnd::Plugin_GetPluginNames, CFlashVideoDownloadsWnd::Plugin_GetPluginNames, CTorrentsWnd::Plugin_GetPluginNames, CShedulerWnd::Plugin_GetPluginNames, CHFEWnd::Plugin_GetPluginNames, CSitesWnd::Plugin_GetPluginNames, CSpiderWnd::Plugin_GetPluginNames }; fntSetLanguage afnSL [] = { CDownloadsWnd::Plugin_SetLanguage, CFlashVideoDownloadsWnd::Plugin_SetLanguage, CTorrentsWnd::Plugin_SetLanguage, CShedulerWnd::Plugin_SetLanguage, CHFEWnd::Plugin_SetLanguage, CSitesWnd::Plugin_SetLanguage, CSpiderWnd::Plugin_SetLanguage }; UINT aIDBmps [] = { IDB_TOOL_DLDS, IDB_TOOL_DLDS, IDB_TOOL_BT, IDB_TOOL_SCHEDULE, IDB_TOOL_HFE, IDB_TOOL_SITES, IDB_TOOL_SPIDER }; UINT aIDBmpsD [] = { IDB_TOOL_DLDS_D, IDB_TOOL_DLDS_D, IDB_TOOL_BT_D, IDB_TOOL_SCHEDULE_D, IDB_TOOL_HFE_D, IDB_TOOL_SITES_D, IDB_TOOL_SPIDER_D }; fntGetMenuImages afnGMI [] = { CDownloadsWnd::Plugin_GetMenuImages, CFlashVideoDownloadsWnd::Plugin_GetMenuImages, CTorrentsWnd::Plugin_GetMenuImages, CShedulerWnd::Plugin_GetMenuImages, CHFEWnd::Plugin_GetMenuImages, CSitesWnd::Plugin_GetMenuImages, CSpiderWnd::Plugin_GetMenuImages }; fntGetTBInfo afnGTBI [] = { CDownloadsWnd::Plugin_GetToolBarInfo, CFlashVideoDownloadsWnd::Plugin_GetToolBarInfo, CTorrentsWnd::Plugin_GetToolBarInfo, CShedulerWnd::Plugin_GetToolBarInfo, CHFEWnd::Plugin_GetToolBarInfo, CSitesWnd::Plugin_GetToolBarInfo, CSpiderWnd::Plugin_GetToolBarInfo }; fntGetMenuViewItems afnGMVI [] = { CDownloadsWnd::Plugin_GetMenuViewItems, CFlashVideoDownloadsWnd::Plugin_GetMenuViewItems, CTorrentsWnd::Plugin_GetMenuViewItems, CShedulerWnd::Plugin_GetMenuViewItems, CHFEWnd::Plugin_GetMenuViewItems, CSitesWnd::Plugin_GetMenuViewItems, CSpiderWnd::Plugin_GetMenuViewItems }; for (int i = 0; i < cPlugins; i++) { LPCSTR pszPlug, psz; afnGPN [i] (&psz, &pszPlug); plug.hWnd = afnCMW [i] (m_pPluginsFrame->m_hWnd); if (plug.hWnd == NULL) { if (i == 0) return FALSE; continue; } plug.hMenuMain = afnGMM [i] (); plug.hMenuView = afnGVM [i] (); fsnew1 (plug.pbmpMenuImages, CBitmap); plug.pbmpMenuImages->Attach (SBMP (aIDBmps [i])); fsnew1 (plug.pbmpMenuDImages, CBitmap); plug.pbmpMenuDImages->Attach (SBMP (aIDBmpsD [i])); afnGMI [i] (&plug.pMenuMainImages, &plug.cMenuMainImages); plug.pMenuViewImages = NULL; plug.cMenuViewImages = 0; plug.pfnGPN = afnGPN [i]; plug.pfnGTBI = afnGTBI [i]; plug.pfnGMVI = afnGMVI [i]; plug.pfnSetLanguage = afnSL [i]; plug.pfnRTS = NULL; plug.pfnShutdown = NULL; afnGMVI [i] (&plug.pMenuViewItems, &plug.cMenuViewItems); m_vWndPlugs.add (plug); wgTButtonInfo* pButtons; int cButtons; afnGTBI [i] (&pButtons, &cButtons); CBitmap bmp1, bmp2; bmp1.Attach (SBMP (aIDBmps [i])); bmp2.Attach (SBMP (aIDBmpsD [i])); if (_TB_USE_ALPHA) { ConvertBmp32WithAlphaToBmp32WithoutAlpha (bmp1, GetSysColor (COLOR_3DFACE)); ConvertBmp32WithAlphaToBmp32WithoutAlpha (bmp2, GetSysColor (COLOR_3DFACE)); } _TBMgr.InsertGroup (pButtons, &bmp1, &bmp2, cButtons); } return TRUE; }
void Mouse(char ch) { if(ch=='o') bar(0); else if(ch=='n') { setfillstyle(SOLID_FILL,15); hidemouse(); bar(42,62,598,458); mousecall(); setcolor(c); bar(c); } int cl,x5,y5,tool; int x1=604,y1=70,z=616,w=84; setfillstyle(cc,c); bar(12,290,27,310); //fillp show bar do { if(ch=='n') { ch='k'; if(tool==4) fout<<"setfillstyle(SOLID_FILL,"<<c<<");\n"; else if(tool==1) fout<<"setfillstyle(SOLID_FILL,15);\n"; else if(tool==6) fout<<"setfillstyle("<<cc<<','<<c<<");\n"; fout<<"setcolor("<<c<<");\n"; fout<<"rectangle(42,62,598,458);\n"; } mousecall(); x1=604,y1=70,z=616,w=84; for(int i=0;i<8;i++,y1+=25,w+=25) { mousepos(cl,x5,y5); if(x5>=x1&&x5<=z&&y5>=y1&&y5<=w) if(cl==1) { static int v=1; if(v!=c) { fout<<"setfillstyle(SOLID_FILL,"<<c<<");\n"; fout<<"setcolor("<<c<<");\n"; fout<<"rectangle(42,62,598,458);\n"; v=c; } c=i; setfillstyle(cc,c); bar(12,290,27,310); setfillstyle(SOLID_FILL,c); } } x1=621,y1=70,z=633,w=84; for( i=8;i<16;i++,y1+=25,w+=25) { mousepos(cl,x5,y5); if(x5>=x1&&x5<=z&&y5>=y1&&y5<=w) if(cl==1) { static int v=0; c=i; setfillstyle(cc,c); bar(12,290,27,310); setfillstyle(SOLID_FILL,c); if(v!=c) { fout<<"setfillstyle(SOLID_FILL,"<<c<<");\n"; fout<<"setcolor("<<c<<");\n"; fout<<"rectangle(42,62,598,458);\n"; v=c; } } } x1=605,y1=320,z=637,w=457; for(i=7;i<11;i++,y1+=25,w+=25) { mousepos(cl,x5,y5); if(x5>=x1&&x5<=z&&y5>=y1&&y5<=w) if(cl==1) { static int v=0; cc=i; setfillstyle(cc,c); bar(12,290,27,310); if(v!=cc) { fout<<"setfillstyle("<<cc<<','<<c<<");\n"; v=cc; } } } x1=5,y1=320,z=37,w=457; for(i=2;i<7;i++,y1+=25,w+=25) { mousepos(cl,x5,y5); if(x5>=x1&&x5<=z&&y5>=y1&&y5<=w) if(cl==1) { static int v=0; cc=i; setfillstyle(cc,c); bar(12,290,27,310); if(v!=cc) { fout<<"setfillstyle("<<cc<<','<<c<<");\n"; v=cc; } } } bar(c); delay(100); mousepos(cl,x5,y5); if(x5>=621&&x5<=635&&y5>=3&&y5<=16) //changes made !!! { if(cl==1) { hidemouse(); break; } } mousepos(cl,x5,y5); int gg=0; gg=help_bar(gg); while(x5>=24&&x5<=36&&y5>=70&&y5<=84) { mousepos(cl,x5,y5); setcolor(0); settextstyle(SMALL_FONT,0,4); outtextxy(45,464,"RECTANGLE "); gg=1; if(cl==1) { tool=0; } } gg=help_bar(gg); static int er=1; mousepos(cl,x5,y5); while(x5>=6&&x5<=18&&y5>=145&&y5<=159) { mousepos(cl,x5,y5); setcolor(0); settextstyle(SMALL_FONT,0,4); outtextxy(45,464,"ERASER "); gg=1; if(cl==1 && er==1) { tool=1; bar(15); fout<<"setfillstyle(SOLID_FILL,15);\n"; fout<<"setcolor(15);\n"; er=2; } } if(tool!=1) { bar(c); er=1; } gg=help_bar(gg); mousepos(cl,x5,y5); while(x5>=6&&x5<=18&&y5>=70&&y5<=84) { mousepos(cl,x5,y5); setcolor(0); settextstyle(SMALL_FONT,0,4); outtextxy(45,464,"LINE"); gg=1; if(cl==1) { tool=2; } } gg=help_bar(gg); mousepos(cl,x5,y5); while(x5>=6&&x5<=18&&y5>=90&&y5<=109) { mousepos(cl,x5,y5); setcolor(0); settextstyle(SMALL_FONT,0,4); outtextxy(45,464,"CIRCLE"); gg=1; if(cl==1) { tool=3; } } gg=help_bar(gg); mousepos(cl,x5,y5); while(x5>=24&&x5<=36&&y5>=120&&y5<=134) { mousepos(cl,x5,y5); setcolor(0); settextstyle(SMALL_FONT,0,4); outtextxy(45,464,"BUCKET"); gg=1; if(cl==1) { if(cc!=1) { fout<<"setfillstyle(SOLID_FILL,"<<c<<");\n"; cc=1; } tool=4; } } gg=help_bar(gg); mousepos(cl,x5,y5); while(x5>=24&&x5<=36&&y5>=90&&y5<=109) { mousepos(cl,x5,y5); setcolor(0); settextstyle(SMALL_FONT,0,4); outtextxy(45,464,"BRUSH "); gg=1; if(cl==1) { tool=5; } } gg=help_bar(gg); mousepos(cl,x5,y5); while(x5>=6&&x5<=18&&y5>=120&&y5<=134) { mousepos(cl,x5,y5); setcolor(0); settextstyle(SMALL_FONT,0,4); gg=1; outtextxy(45,464,"FILLER"); if(cl==1) { tool=6; } } gg=help_bar(gg); mousepos(cl,x5,y5); static int v=0; if(x5>39 && x5<78 && y5>=42 && y5<=55) //save { if(cl==1) { char f[20]; hidemouse(); SBMP("temp.bmp"); if(op('b')) { strcpy(f,s); if(!strchr(f,'.')) strcat(f,".bmp"); int check; check=rename("temp.bmp",f); if(check==-1) { remove(f); rename("temp.bmp",f); } } if(v==0) { if(op('c')) { v=1; if(!strchr(s,'.')) strcat(s,".cpp"); strcpy(::f,s); } else if(bmp("temp.bmp",0,0)) {} else bmp(f,0,0); } if(bmp(f,0,0)); else bmp("temp.bmp",0,0); mousecall(); } } mousepos(cl,x5,y5); if(x5>=10 && x5<39 && y5>=42 && y5<=55) //open { if(cl==1) { hidemouse(); SBMP("temp.bmp"); if(op('o')) { if(!strchr(s,'.')) strcat(s,".bmp"); if(bmp(s,0,0)) { settextstyle(2,0,7); cleardevice(); setcolor(RED); outtextxy(200,220," SUCH FILE DOES NOT EXIST"); outtextxy(200,280,"PRESS ENTER TO CONTINUE:"); getch(); bmp("temp.bmp",0,0); } } else bmp("temp.bmp",0,0); mousecall(); } } mousepos(cl,x5,y5); if(x5>78 && x5<111 && y5>=42 && y5<=55) //new { if(cl==1) { v=0; main('n'); } } mousepos(cl,x5,y5); if(x5>111 && x5<174 && y5>=42 && y5<=55) //password change { if(cl==1) { hidemouse(); SBMP("temp.bmp"); if(op('p')) { ofstream fout("pass.txt"); char t[20]; for(int m=0;s[m]!='\0';m++) { t[m]=s[m]-27; } t[m]='\0'; fout<<t; fout.close(); } bmp("temp.bmp",0,0); mousecall(); } } mousepos(cl,x5,y5); if(x5>174 && x5<217 && y5>=42 && y5<=55) //help { if(cl==1) { hidemouse(); SBMP("temp.bmp"); help(); bmp("temp.bmp",0,0); mousecall(); } } while(x5>43 && x5<597 && y5>63 && y5<457) { mousepos(cl,x5,y5); mousecall(); if(cl==1 && x5>43 && x5<597 && y5>63 && y5<457 ) { double a,b,p,x1,y1,x2,y2; static int v1=0,v2=0,v3=0,v4=0; double r; switch(tool) { case 0://rectangle mousecall(); x1=x5; y1=y5; delay(500); restrict(43,597,63,457); mousepos(cl,x5,y5); x2=x5,y2=y5; setcolor(c); hidemouse(); rectangle(x1,y1,x2,y2); if(v1!=x1 || v2!=x2 || v3!=y1 || v4!=y2) { fout<<"rectangle("<<x1<<','<<y1<<','<<x2<<','<<y2<<");\n"; v1=x1,v2=x2,v3=y1,v4=y2; } mousecall(); restrict(0,640,0,480); break; case 1:eraser(); break; case 2://line(); mousecall(); x1=x5; y1=y5; delay(500); restrict(43,597,63,457); mousepos(cl,x5,y5); x2=x5,y2=y5; setcolor(c); hidemouse(); line(x1,y1,x2,y2); if(v1!=x1 || v2!=x2 || v3!=y1 || v4!=y2) { fout<<"line("<<x1<<','<<y1<<','<<x2<<','<<y2<<");\n"; v1=x1,v2=x2,v3=y1,v4=y2; } mousecall(); restrict(0,640,0,480); break; case 3://circle(); mousecall(); x1=x5; y1=y5; delay(500); restrict(43,597,63,457); mousepos(cl,x5,y5); x2=x5,y2=y5; a=(x1-x2)*(x1-x2),b=(y1-y2)*(y1-y2); p=a+b; r=SQRT(p); setcolor(c); int c1=x1+r,c2=x1-r,c3=y1+r,c4=y1-r; hidemouse(); circle(x1,y1,r); if(v1!=x1 || v2!=y1) { fout<<"circle("<<x1<<','<<y1<<','<<r<<");\n"; v1=x1,v2=y1; } if(c1>597 || c2<43 || c3>457 || c4<63) SCREEN(); mousecall(); restrict(0,640,0,480); break; case 4:bucket(); break; case 5:brush(x5,y5); break; case 6:fillp(); break; default:brush(x5,y5); } } } }while(1); }