亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? babygrid.cpp

?? 文字編輯器源碼 Text editor source code
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
     for(j=0;j<(int)lstrlen(text);j++)
         {
          if(text[j]=='\n')
              {
               lines++;
              }
         }
     lstrcpy(temptext,text);
     p = generic_strtok(temptext, TEXT("\n"));
     while(p)
         {
          GetTextExtentPoint32(hdc,p,lstrlen(p),size);
          if(size->cx > longest)
              {
               longest=size->cx;
              }
          p = generic_strtok('\0', TEXT("\n"));
         }
     return longest;
    }


LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	int wmId, wmEvent;
	PAINTSTRUCT ps;
	HDC hdc;
	TCHAR buffer[1000];
	int SelfIndex;
	int ReturnValue;
    UINT SelfMenu;
	HINSTANCE hInst;
    int iDataType;
    static int ASCII;
    

	SelfIndex=FindGrid((UINT)GetMenu(hWnd));
    SelfMenu=BGHS[SelfIndex].gridmenu;

	//update the grid width and height variable
	{
	 RECT rect;
	 
	 GetClientRect(hWnd,&rect);
	 BGHS[SelfIndex].gridwidth = rect.right - rect.left;
	 BGHS[SelfIndex].gridheight = rect.bottom - rect.top;

	}

	ReturnValue = 0;

	switch (message) 
	{
		case WM_COMMAND:
			wmId    = LOWORD(wParam); 
			wmEvent = HIWORD(wParam); 
			// Parse the menu selections:
			switch (wmId)
			{
                case 1:
				default:
				   return DefWindowProc(hWnd, message, wParam, lParam);
			}
			break;

		case WM_PAINT:
			hdc = BeginPaint(hWnd, &ps);
			RECT rt;
			GetClientRect(hWnd, &rt);
			CalcVisibleCellBoundaries(SelfIndex);
            //display title
            DisplayTitle(hWnd,SelfIndex,BGHS[SelfIndex].htitlefont);
			//display column 0;

			DisplayColumn(hWnd,SelfIndex,0,0,BGHS[SelfIndex].hfont,BGHS[SelfIndex].hcolumnheadingfont);
			    {
			     int c,j,k,offset;
			     offset = BGHS[SelfIndex].columnwidths[0];
			     j=BGHS[SelfIndex].leftvisiblecol;
			     k=BGHS[SelfIndex].rightvisiblecol;
			     for(c=j;c<=k;c++)
			         {
			          DisplayColumn(hWnd,SelfIndex,c,offset,BGHS[SelfIndex].hfont,BGHS[SelfIndex].hcolumnheadingfont);
			          offset+=BGHS[SelfIndex].columnwidths[c];
			         }
			 
			    }
			EndPaint(hWnd, &ps);
			//
			if(GetFocus()==hWnd)
				{
			      PostMessage(hWnd,BGM_DRAWCURSOR,(UINT)SelfIndex,0);
				}


			break;


        case BGM_PAINTGRID:
            {
             RECT rect;
             GetClientRect(hWnd, &rect);
             InvalidateRect(hWnd,&rect,TRUE);
             UpdateWindow(hWnd);
             MessageBeep(0);
            }
            break;
        case WM_SETTEXT: 
            { 
              int j,linecount;
              SIZE size;
              HDC gdc;
              HFONT holdfont;
              if(lstrlen((TCHAR*)lParam)>300)
                  {
                   lstrcpy(BGHS[SelfIndex].title, TEXT("Title too long (300 chars max)"));
                  }
              else
                  {
                    lstrcpy(BGHS[SelfIndex].title,(TCHAR*)lParam);
                  }
             
             gdc=GetDC(hWnd);
             //get linecount of title;
             if(lstrlen(BGHS[SelfIndex].title) > 0)
                 {
                  linecount=1;
                  for(j=0;j<(int)lstrlen(BGHS[SelfIndex].title);j++)     
                      {
                       if(BGHS[SelfIndex].title[j]=='\n')
                           {
                            linecount++;
                           }

                      }
                  holdfont=(HFONT)SelectObject(gdc,BGHS[SelfIndex].htitlefont);
                  GetTextExtentPoint32(gdc,BGHS[SelfIndex].title,lstrlen(BGHS[SelfIndex].title),&size);
                  SelectObject(gdc,holdfont);
                  BGHS[SelfIndex].titleheight = (int)((size.cy*1.2) * linecount);
                 }
             else
                 {
                  //no title
                  BGHS[SelfIndex].titleheight = 0;
                 }
              ReleaseDC(hWnd,gdc);

              
			  RefreshGrid(hWnd);
              SizeGrid(hWnd,SelfIndex);
              
            }
            break;
        case BGM_GETROWS:
              ReturnValue = BGHS[SelfIndex].rows;
            break;

        case BGM_GETCOLS:
              ReturnValue = BGHS[SelfIndex].cols;
            break;

        case BGM_GETCOLWIDTH:
              ReturnValue = BGHS[SelfIndex].columnwidths[wParam];
            break;

        case BGM_GETROWHEIGHT:
               ReturnValue = BGHS[SelfIndex].rowheight;
            break;

        case BGM_GETHEADERROWHEIGHT:
               ReturnValue = BGHS[SelfIndex].headerrowheight;
            break;

        case BGM_GETOWNERDRAWITEM:
              ReturnValue = BGHS[SelfIndex].ownerdrawitem;
            break;

		case BGM_DRAWCURSOR:
			  DrawCursor(hWnd,wParam);
			break;
        case BGM_SETCURSORPOS:
               DrawCursor(hWnd,SelfIndex);
               if((((int)wParam <= BGHS[SelfIndex].rows)&&((int)wParam > 0))&&
                   (((int)lParam <= BGHS[SelfIndex].cols)&&((int)lParam > 0)))
                   {
                     BGHS[SelfIndex].cursorrow=wParam;
                     BGHS[SelfIndex].cursorcol=lParam;
                   }
               else
                   {
                    DrawCursor(hWnd,SelfIndex);
                    break;
                   }
               SetHomeRow(hWnd,SelfIndex,BGHS[SelfIndex].cursorrow,BGHS[SelfIndex].cursorcol);
               SetHomeCol(hWnd,SelfIndex,BGHS[SelfIndex].cursorrow,BGHS[SelfIndex].cursorcol);
               DrawCursor(hWnd,SelfIndex);
               RefreshGrid(hWnd);

            break;
		case BGM_SHOWHILIGHT:
			   BGHS[SelfIndex].DRAWHIGHLIGHT = (BOOL)wParam;
               RefreshGrid(hWnd);
			break;
        case BGM_EXTENDLASTCOLUMN:
               BGHS[SelfIndex].EXTENDLASTCOLUMN = (BOOL)wParam;
               RefreshGrid(hWnd);
            break;

        case BGM_SHOWINTEGRALROWS:
               BGHS[SelfIndex].SHOWINTEGRALROWS = (BOOL)wParam;
               SizeGrid(hWnd,SelfIndex);
               RefreshGrid(hWnd);
            break;

        case BGM_SETCOLAUTOWIDTH:
               BGHS[SelfIndex].COLAUTOWIDTH = (BOOL)wParam;
            break;

        case BGM_SETALLOWCOLRESIZE:
               BGHS[SelfIndex].ALLOWCOLUMNRESIZING = (BOOL)wParam;
            break;

		case BGM_PROTECTCELL:
              LPBGcell=(_BGCELL*)wParam;
              if(OutOfRange(LPBGcell))
                  {
                   wParam=MAKEWPARAM((UINT)GetMenu(hWnd),BGN_OUTOFRANGE);
                   lParam = 0;
                   SendMessage(GetParent(hWnd),WM_COMMAND,wParam,lParam);
				   ReturnValue = -1;
                   break;
                  }
              wsprintf(buffer, TEXT("%05d-%03d"), LPBGcell->row,LPBGcell->col);
              //see if that cell is already loaded
              FindResult = BinarySearchListBox(BGHS[SelfIndex].hlist1,buffer);
              if(FindResult != LB_ERR)
                  {
                   //it was found, get the text, modify text delete it from list, add modified to list
				   SendMessage(BGHS[SelfIndex].hlist1,LB_GETTEXT,FindResult,(LPARAM)buffer);
				   if((BOOL)lParam)
				   {
					buffer[10] = 'P';
				   }
				   else
				   {
					buffer[10] = 'U';
				   }
                   SendMessage(BGHS[SelfIndex].hlist1,LB_DELETESTRING,FindResult,0);
				   SendMessage(BGHS[SelfIndex].hlist1,LB_ADDSTRING,FindResult,(LPARAM)buffer);
                  }
			  else
			  {
			   //protecting or unprotecting a cell that isn't in the list
			   //add it as blank;
				  lstrcat(buffer, TEXT("|"));
				  if((BOOL)lParam)
				  {
				   lstrcat(buffer, TEXT("PA"));
				  }
				  else
				  {
				   lstrcat(buffer, TEXT("UA"));
				  }
				  lstrcat(buffer, TEXT("|"));
				  SendMessage(BGHS[SelfIndex].hlist1,LB_ADDSTRING,FindResult,(LPARAM)buffer);
			  }

			break;
		case BGM_NOTIFYROWCHANGED:
			   NotifyRowChanged(hWnd,SelfIndex);
			break;
		case BGM_NOTIFYCOLCHANGED:
			   NotifyColChanged(hWnd,SelfIndex);
			break;
		case BGM_SETPROTECT:
			  if((BOOL)wParam)
                  {
			       lstrcpy(BGHS[SelfIndex].protect, TEXT("P"));
			      }
			      else      
                  {                
			       lstrcpy(BGHS[SelfIndex].protect, TEXT("U"));
			      }
			break;

		case BGM_AUTOROW:
			  if((BOOL)wParam)
			  {
			   BGHS[SelfIndex].AUTOROW = TRUE;
			  }
			  else
			  {
			   BGHS[SelfIndex].AUTOROW = FALSE;
			  }
			break;
        case BGM_SETEDITABLE:
               if((BOOL)wParam)
                   {
                    BGHS[SelfIndex].EDITABLE = TRUE;
                   }
               else
                   {
                    BGHS[SelfIndex].EDITABLE = FALSE;
                   }
            break;

        case BGM_SETCELLDATA:
              LPBGcell=(_BGCELL*)wParam;
              if(OutOfRange(LPBGcell))
                  {
                   wParam=MAKEWPARAM((UINT)GetMenu(hWnd),BGN_OUTOFRANGE);
                   lParam = 0;
                   SendMessage(GetParent(hWnd),WM_COMMAND,wParam,lParam);
				   ReturnValue = -1;
                   break;
                  }
              wsprintf(buffer, TEXT("%05d-%03d"), LPBGcell->row,LPBGcell->col);
              //see if that cell is already loaded
              FindResult = BinarySearchListBox(BGHS[SelfIndex].hlist1,buffer);
              if(FindResult != LB_ERR)
                  {
                   //it was found, delete it
                   SendMessage(BGHS[SelfIndex].hlist1,LB_DELETESTRING,FindResult,0);
                  }
              //now add it
			  lstrcat(buffer, TEXT("|"));
			  lstrcat(buffer,BGHS[SelfIndex].protect);
              //determine data type (text,numeric, or boolean)(1,2,3)
              //iDataType=DetermineDataType((TCHAR*)lParam);

			  iDataType = 1;
              if(iDataType==1){lstrcat(buffer, TEXT("A"));}
              if(iDataType==2){lstrcat(buffer, TEXT("N"));}
              if(iDataType==3){lstrcat(buffer, TEXT("T"));}
              if(iDataType==4){lstrcat(buffer, TEXT("F"));}
			  if(iDataType==5){lstrcat(buffer, TEXT("G"));}

			  lstrcat(buffer, TEXT("|"));
              lstrcat(buffer, (TCHAR*)lParam);
              FindResult=SendMessage(BGHS[SelfIndex].hlist1,LB_ADDSTRING,0,(LPARAM)buffer);
              
              if(FindResult==LB_ERR)
                  {
                   MessageBeep(0);
                  }
                  {
                   RECT rect;
                   rect=GetCellRect(hWnd,SelfIndex,LPBGcell->row,LPBGcell->col);
                   InvalidateRect(hWnd,&rect,FALSE);
                  }
              //get the last line and adjust grid dimmensions
                  if(BGHS[SelfIndex].AUTOROW)
                  {
                   int j;
                    j=SendMessage(BGHS[SelfIndex].hlist1,LB_GETCOUNT,0,0);
                    if(j>0)
                        {
                         SendMessage(BGHS[SelfIndex].hlist1,LB_GETTEXT,j-1,(LPARAM)buffer);
                         buffer[5]=0x00;
                         j=generic_atoi(buffer);
                         if(j>SendMessage(hWnd,BGM_GETROWS,0,0))
                             {
                              SendMessage(hWnd,BGM_SETGRIDDIM,j,BGHS[SelfIndex].cols);
                             }
                        }
                    else
                        {
                         //no items in the list
                        SendMessage(hWnd,BGM_SETGRIDDIM,j,BGHS[SelfIndex].cols);
                        }
                  }

                  //adjust the column width if COLAUTOWIDTH==TRUE
                  if((BGHS[SelfIndex].COLAUTOWIDTH)||(LPBGcell->row == 0))
                      {
                       HDC hdc;
                       SIZE size;
                       int required_width;
                       int current_width;
                       int required_height = 30;
                       int current_height;
                       int longestline;
                       HFONT holdfont;
                       hdc=GetDC(hWnd);
                       if(LPBGcell->row == 0)
                           {
                             holdfont=(HFONT)SelectObject(hdc,BGHS[SelfIndex].hcolumnheadingfont);
                           }
                           else
                           {
                             holdfont=(HFONT)SelectObject(hdc,BGHS[SelfIndex].hfont);
                           }
                       //if there are \n codes in the generic_string, find the longest line
                       longestline=FindLongestLine(hdc,(TCHAR*)lParam,&size);
                       //GetTextExtentPoint32(hdc,(TCHAR*)lParam,lstrlen((TCHAR*)lParam),&size);
                       required_width = longestline+15;
                       required_height = size.cy;
                       //count lines
                           {
                               int count=1;
                               TCHAR tbuffer[255];
                               lstrcpy(tbuffer,(TCHAR*)lParam);
                               for(int j=0;j<(int)lstrlen(tbuffer);j++)
                                   {
                                   if(tbuffer[j]=='\n'){count++;}
                                   }
                               if((!BGHS[SelfIndex].ELLIPSIS)||(LPBGcell->row == 0))
                                   {
                                    required_height *= count;
                                   }
                               required_height +=5;
                           }
                       SelectObject(hdc,holdfont);
                       ReleaseDC(hWnd,hdc);
                       current_width = BGHS[SelfIndex].columnwidths[LPBGcell->col];
                       if(LPBGcell->row == 0)
                           {
                            current_height = BGHS[SelfIndex].headerrowheight;
                            if(required_height > current_height)
                                {
                                 SendMessage(hWnd,BGM_SETHEADERROWHEIGHT,required_height,0);
                                }
                           }
                       else
                           {
                            current_height = BGHS[SelfIndex].rowheight;
                            if(required_height > current_height)
							{
                                 SendMessage(hWnd, BGM_SETROWHEIGHT, /*required_height*/20, 0);
                            }

                           }
                       if(required_width > current_width)
                           {
                            SendMessage(hWnd,BGM_SETCOLWIDTH,LPBGcell->col,required_width);
                           }
                       ReleaseDC(hWnd,hdc);
                      }

            break;

        case BGM_GETCELLDATA:
              LPBGcell=(_BGCELL*)wParam;
              if(OutOfRange(LPBGcell))
                  {
                   wParam=MAKEWPARAM((UINT)GetMenu(hWnd),BGN_OUTOFRANGE);
                   lParam = 0;
                   SendMessage(GetParent(hWnd),WM_COMMAND,wParam,lParam);
				   ReturnValue = -1;
                   break;
                  }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国内不卡的二区三区中文字幕 | 亚洲成人手机在线| 播五月开心婷婷综合| 久久精品男人天堂av| 国产精品一区二区视频| 精品国产一区二区三区av性色| 日韩国产成人精品| 欧美电影免费观看高清完整版在| 日本一道高清亚洲日美韩| 欧美成人vr18sexvr| 激情综合色综合久久| 国产欧美精品在线观看| 99精品一区二区三区| 亚洲成a人v欧美综合天堂下载 | 欧美日韩成人综合天天影院 | 51精品国自产在线| 韩日欧美一区二区三区| 亚洲成人久久影院| 欧美成人性福生活免费看| 国产91在线看| 秋霞午夜鲁丝一区二区老狼| 国产精品久久久久久妇女6080| 欧美亚洲丝袜传媒另类| 国产不卡一区视频| 午夜精品福利一区二区三区蜜桃| 久久影院午夜论| 欧美日本在线一区| 成人福利视频网站| 激情欧美日韩一区二区| 亚洲成av人影院在线观看网| 国产欧美精品一区二区色综合 | 日韩午夜在线观看| 91麻豆国产福利精品| 久久99精品国产| 日韩av高清在线观看| 最新国产の精品合集bt伙计| 久久先锋资源网| 精品免费国产一区二区三区四区| 欧美在线一二三四区| 99久久99久久久精品齐齐| 国产精品一区二区你懂的| 国产精品99久久久久久久vr| 免费观看久久久4p| 免费观看一级欧美片| 免费看欧美美女黄的网站| 日本欧美在线看| 免费成人在线网站| 久久成人av少妇免费| 免费欧美高清视频| 美女视频网站黄色亚洲| 奇米色一区二区三区四区| 日韩精品电影一区亚洲| 日本视频中文字幕一区二区三区| 性欧美大战久久久久久久久| 视频一区视频二区中文| 免费成人av在线播放| 久久99精品国产.久久久久久| 国产一区二区毛片| 91丨porny丨国产| 欧美日韩精品一区二区三区四区| 欧美日韩在线精品一区二区三区激情| 91久久精品一区二区| 国产三级一区二区| 亚洲精品ww久久久久久p站| 天天综合网 天天综合色| 国产精品1区二区.| 91在线观看免费视频| 91精品久久久久久久99蜜桃| 国产欧美综合在线| 99久久国产免费看| 欧美日本视频在线| 欧美精品一区二区三区蜜桃视频| **网站欧美大片在线观看| 国产另类ts人妖一区二区| 日韩片之四级片| 一区二区在线免费观看| 久久99精品久久久久久动态图| 91麻豆.com| 国产亚洲综合性久久久影院| 亚洲国产精品自拍| 一本一本大道香蕉久在线精品| 日韩欧美视频一区| 一区二区久久久| 99精品久久免费看蜜臀剧情介绍| 久久久久久久一区| 美腿丝袜亚洲色图| 欧美精品日韩一区| 亚洲一区二区三区中文字幕在线| thepron国产精品| 国产精品久久久久久久裸模| 国产麻豆精品视频| 欧美日本一区二区三区| 午夜精品一区在线观看| 色久综合一二码| 亚洲欧美日韩一区二区三区在线观看| 国产一区二区三区四区五区入口| 精品国内二区三区| 国产一区二区调教| 久久精品欧美日韩精品| 成人综合在线观看| 自拍偷拍欧美激情| 在线亚洲免费视频| 日韩av一二三| 国产日韩欧美在线一区| 风间由美一区二区三区在线观看| 亚洲欧美一区二区在线观看| 不卡高清视频专区| 亚洲无线码一区二区三区| 欧美午夜寂寞影院| 精品中文av资源站在线观看| 国产日韩欧美在线一区| 色综合中文综合网| 欧美制服丝袜第一页| 午夜国产精品影院在线观看| 日韩欧美久久一区| av在线综合网| 日本美女一区二区三区视频| 国产日韩欧美不卡在线| 91尤物视频在线观看| 久久99久久久久| 一区二区三区国产精品| 日韩视频在线永久播放| 一本久久综合亚洲鲁鲁五月天| 麻豆国产精品视频| 亚洲欧美日韩精品久久久久| 久久久综合网站| 日韩欧美精品在线| 欧美日韩国产精选| 91在线观看成人| aaa欧美日韩| 国产精品一品二品| 国内外成人在线| 日本va欧美va精品| 日本欧美一区二区三区乱码| 亚洲激情在线激情| 亚洲欧美日韩在线播放| 中文字幕一区二区三区色视频| 精品国产人成亚洲区| 日韩精品一区二区三区四区视频 | 亚洲欧美一区二区视频| 国产精品每日更新在线播放网址| 欧美一区二区免费观在线| 欧美亚洲国产一区二区三区 | 国产在线精品一区二区三区不卡| 免费成人在线网站| 美女爽到高潮91| 国产高清成人在线| 国v精品久久久网| 成人动漫一区二区| 99re这里只有精品首页| 91在线观看视频| 欧美三级一区二区| 欧美人与z0zoxxxx视频| 日韩视频免费观看高清完整版在线观看| 欧美久久一二三四区| 欧美成人vr18sexvr| 中文字幕在线观看一区二区| 亚洲精品伦理在线| 美女精品自拍一二三四| 国产白丝精品91爽爽久久| 99精品欧美一区二区蜜桃免费| 色偷偷成人一区二区三区91| 欧美精品v国产精品v日韩精品 | 99re成人在线| 制服丝袜亚洲色图| 久久九九99视频| 亚洲国产成人porn| 国产成人自拍网| 欧美在线免费视屏| 久久精品亚洲一区二区三区浴池| 国产精品伦理在线| 蜜臀久久99精品久久久久久9| thepron国产精品| 久久久久国产精品厨房| 亚洲午夜免费福利视频| 国产v日产∨综合v精品视频| 欧美一区二区精品久久911| 日本一区二区综合亚洲| 性做久久久久久免费观看欧美| av电影在线观看完整版一区二区| 精品国产一二三区| 麻豆91在线观看| 欧美日韩国产影片| 亚洲视频免费看| 99精品久久只有精品| 国产精品网站一区| 国产一区欧美二区| 欧美精品一区二区三区蜜桃视频| 毛片av中文字幕一区二区| 欧美日韩中文字幕一区| 午夜欧美一区二区三区在线播放| 色偷偷一区二区三区| 亚洲黄色片在线观看| 色噜噜久久综合| 亚洲国产日韩a在线播放| 欧美综合久久久| 亚洲国产视频一区| 欧美一级xxx| 激情小说欧美图片| 国产欧美日韩中文久久|