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

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

?? stocksmain.cpp

?? DevExpress公司出品的Borland Delphi和C++ Builder的控件(包含完整源代碼)。 ExpressSpreadSheet:交叉數(shù)據(jù)表格控件。 一款Delphi
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
//---------------------------------------------------------------------------
#include <vcl.h>
#include <stdlib.h>
#pragma hdrstop

#include "StocksMain.h"
#include "StocksModify.h"
#include "string.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "cxControls"
#pragma link "cxSSheet"
#pragma resource "*.dfm"
TStocksMainForm *StocksMainForm;
//---------------------------------------------------------------------------
__fastcall TStocksMainForm::TStocksMainForm(TComponent* Owner)
  : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TStocksMainForm::SetCellText(int ACol, int ARow, String AText)
{
  TcxSSCellObject *CellObject;
  // get a cell object for the request col and row
  CellObject = cxSpreadBook->ActiveSheet->GetCellObject(ACol, ARow);
  try {
//    edtCellEdit->Text = CellObject->Text;
    CellObject->SetCellText(AText, true);
  }
  __finally {
    delete CellObject;                                      // and free it
  }
}

void __fastcall TStocksMainForm::SetCellDate(int ACol, int ARow, TDateTime ADate)
{
  TcxSSCellObject *ObjectCell;
  // get a cell object for the request col and row
  ObjectCell = cxSpreadBook->ActiveSheet->GetCellObject(ACol, ARow);
    try {
      ObjectCell->DateTime = ADate;
    }
    __finally {
      delete ObjectCell;                                    // free it
    }
}

void __fastcall TStocksMainForm::SetCellFont(int ALeftCol, int ATopRow, int ARightCol, int ABottomRow,
                        TFontStyles AStyle, int ASize)
{
  TcxSSCellObject *ObjectCell;
  for(int i = ALeftCol; i <= ARightCol; i++)                // for each column specified
    for(int j = ATopRow; j <= ABottomRow; j++) {            // form each row specified
      ObjectCell = cxSpreadBook->ActiveSheet->GetCellObject(i, j); // get the cell
      try {
        ObjectCell->Style->Font->Style = AStyle;            // set the font style
        ObjectCell->Style->Font->Size = ASize;              // and size
      }
      __finally {
        delete ObjectCell;                                  // free it
      }
    }
}

void __fastcall TStocksMainForm::SetCellPattern(int ALeftCol, int ATopRow, int ARightCol, int ABottomRow,
                           Word ABackground, Word AForeground, TcxSSFillStyle AFillStyle)
{
  TcxSSCellObject *ObjectCell;
  for(int i = ALeftCol; i <= ARightCol; i++)                // for each column specified
    for(int j = ATopRow; j <= ABottomRow; j++) {            // form each row specified
      ObjectCell = cxSpreadBook->ActiveSheet->GetCellObject(i, j);  // get the cell
      try {
        ObjectCell->Style->Brush->BackgroundColor = ABackground;    // set the specified background
        ObjectCell->Style->Brush->ForegroundColor = AForeground;    //               and foreground colour
        ObjectCell->Style->Brush->Style = AFillStyle;               //               and fill style
      }
      __finally {
        delete ObjectCell;
      }
   }
}

void __fastcall TStocksMainForm::SetCellFormat(int ALeftCol, int ATopRow, int ARightCol, int ABottomRow, Word
                          AFormat)
{
  TcxSSCellObject *ObjectCell;
  for(int i = ALeftCol; i <= ARightCol; i++)                // for each column specified
    for(int j = ATopRow; j <= ABottomRow; j++) {            // form each row specified
      ObjectCell = cxSpreadBook->ActiveSheet->GetCellObject(i, j); // get the cell
      try {
        ObjectCell->Style->Format = AFormat;                // set the specified cell format
      }
      __finally {
        delete ObjectCell;
      }
   }
}

void __fastcall TStocksMainForm::SetCellAlignment(int ALeftCol, int ATopRow, int ARightCol, int ABottomRow,
                             TcxHorzTextAlign AHorzAlign, TcxVertTextAlign AVertAlign)
{
  TcxSSCellObject *ObjectCell;
  for(int i = ALeftCol; i <= ARightCol; i++)                // for each column specified
    for(int j = ATopRow; j <= ABottomRow; j++) {            // form each row specified
      ObjectCell = cxSpreadBook->ActiveSheet->GetCellObject(i, j); // get the cell
      try {
        ObjectCell->Style->HorzTextAlign = AHorzAlign;      // set the specified horizontal text alignment
        ObjectCell->Style->VertTextAlign = AVertAlign;      // and vertical alignment
      }
      __finally {
        delete ObjectCell;
      }
   }
}

void __fastcall TStocksMainForm::SetCellBorders(int ALeftCol, int ATopRow, int ARightCol, int ABottomRow,
                           int AEdge, TcxSSEdgeLineStyle AStyle)
{
  TcxSSCellObject *ObjectCell;
  for(int i = ALeftCol; i <= ARightCol; i++)                // for each column specified
    for(int j = ATopRow; j <= ABottomRow; j++) {            // form each row specified
      ObjectCell = cxSpreadBook->ActiveSheet->GetCellObject(i, j); // get the cell
      try {
        switch (AEdge) {
          case 0: ObjectCell->Style->Borders->Left->Style = AStyle;
          case 1: ObjectCell->Style->Borders->Top->Style = AStyle;
          case 2: ObjectCell->Style->Borders->Right->Style = AStyle;
          case 3: ObjectCell->Style->Borders->Bottom->Style = AStyle;
        }
      }
      __finally {
        delete ObjectCell;
      }
   }
}


void __fastcall TStocksMainForm::AlwaysEnabled(TObject *Sender)
{
  ((TCustomAction*)Sender)->Enabled = true;
}
//---------------------------------------------------------------------------
void __fastcall TStocksMainForm::actLoadDataExecute(TObject *Sender)
{
  TCursor CurCursor;
  CurCursor = Screen->Cursor;                               // preserve the current one
  Screen->Cursor = crHourGlass;                             // wait cursor
  try {
    cxSpreadBook->BeginUpdate();                            // turn off updates
    cxSpreadBook->ActivePage = 0;                           // ensure we are looking at the right page
    FCurRow = 3;                                            // set the starting current row
    Query->Open();                                          // open the data
    while (!Query->Eof) {
        SetCellText(0, FCurRow,                             // set the company name
                         Query->FieldByName("CO_NAME")->AsString);
        SetCellText(1,FCurRow,                              // the number of shares
                          Query->FieldByName("SHARES")->AsString);
        SetCellDate(2,FCurRow,                              // the purchase date
                      Query->FieldByName("PUR_DATE")->AsDateTime);
        SetCellText(3,FCurRow,                              // the purchase price
                       Query->FieldByName("PUR_PRICE")->AsString);
        SetCellText(4,FCurRow,                              // calculate the purchase cost = number of shares * purchase price
              Format("=B%d*D%d/100",
              ARRAYOFCONST((FCurRow + 1, FCurRow + 1))));   // [FCurRow+1,FCurRow+1]));
        SetCellText(5,FCurRow,                              // the current price
                       Query->FieldByName("CUR_PRICE")->AsString);
        SetCellText(6,FCurRow,                              // calculate the current valuation = number of shares * current price
              Format("=B%d*F%d/100", ARRAYOFCONST((FCurRow + 1, FCurRow + 1))));
        SetCellText(7,FCurRow,                              // calculate the gain/loss = current valuation - purchase cost
                  Format("=G%d-E%d",ARRAYOFCONST((FCurRow + 1, FCurRow + 1))));
        SetCellText(8,FCurRow,                              // calculate the %age gain/loss
                  Format("=H%d/E%d",ARRAYOFCONST((FCurRow+1,FCurRow+1))));
        Query->Next();                                      // and the next record
        FCurRow++;                                          // and bump the row number
      }
      FCurRow++;
      SetCellText(4, FCurRow,                               // set the formula for the total purchase cost
                       Format("=SUM(E3:E%d)",ARRAYOFCONST((FCurRow - 1))));
      SetCellText(6, FCurRow,                               // total current valuation
                       Format("=SUM(G3:G%d)", ARRAYOFCONST((FCurRow - 1))));
      SetCellText(7, FCurRow,                               // total gain/loss
                       Format("=SUM(H3:H%d)",ARRAYOFCONST((FCurRow - 1))));
      SetCellText(8, FCurRow,                               // and overall percentage
                  Format("=H%d/E%d", ARRAYOFCONST((FCurRow + 1, FCurRow + 1))));
      Query->First();                                       // back to the first record
      cxSpreadBook->ActivePage = 1;                         // and move to the second page
      // and repeat the process to setup the data
      FCurRow = 3;
      while(!Query->Eof){
        SetCellText(0,FCurRow,                              // company name
                         Query->FieldByName("CO_NAME")->AsString);
        SetCellText(1,FCurRow,                              // current price
                       Query->FieldByName("CUR_PRICE")->AsString);
        SetCellText(2,FCurRow,                              // year high
                        Query->FieldByName("YRL_HIGH")->AsString);
        SetCellText(3,FCurRow,                              // year low
                         Query->FieldByName("YRL_LOW")->AsString);
        SetCellText(4,FCurRow,                              // average of Hi/Lo prices
              Format("=(C%d+D%d)/2", ARRAYOFCONST((FCurRow + 1, FCurRow + 1))));
        Query->Next();
        FCurRow++;
      }
      FCurRow++;
      Query->Close();
      FIsApplyFormatting = true;                            // enable the formatting button
    }
  __finally {
    cxSpreadBook->EndUpdate();                              // turn update back on
    cxSpreadBook->Recalc();                                 // auto recalc on
    cxSpreadBook->ActivePage = 0;                           // back to first page
    Screen->Cursor = CurCursor;                             // and back to default cursor
  }
}
//---------------------------------------------------------------------------
void __fastcall TStocksMainForm::FormShow(TObject *Sender)
{
    cxSpreadBook->BeginUpdate();                            // turn off updates
    try {
      cxSpreadBook->AutoRecalc = false;                     // turn off automatic recalculation
      cxSpreadBook->ActiveSheet->Caption = "Current";       // set the page caption for the first page
      cxSpreadBook->AddSheetPage("HiLo");                   // and a second page and set it's caption
      cxSpreadBook->ActivePage = 0;                         // turn our attention to the first page
      SetCellText(0, 0,"Current Stockholding Valuations");  // set a title in the first column, first row cell
      SetCellText(0, 2,"Company");                          // Col A        - Set column titles
      SetCellText(1, 2,"Holding");                          // B
      SetCellText(2, 2,"Purchased");                        // C
      SetCellText(3, 2,"Price");                            // D
      SetCellText(4, 2,"Cost");                             // E  = B * D
      SetCellText(5, 2,"Value");                            // F
      SetCellText(6, 2,"Worth");                            // G  = B * F
      SetCellText(7, 2,"Gain");                             // H  = G - E
      SetCellText(8, 2,"%age Gain");                        // I  = H / E
      cxSpreadBook->ActivePage          = 1;                            // over now to the second page
      SetCellText(0, 0, "High, Low and Current Stock Prices");  // and repeat the process
      SetCellText(0,2,"Company");                           // Col A
      SetCellText(1,2,"Price");                             //     B
      SetCellText(2,2,"High");                              //     C
      SetCellText(3,2,"Low");                               //     D
      SetCellText(4,2,"Average");                           //     E
      cxSpreadBook->AutoRecalc = true;                      // autorecalc back on
      cxSpreadBook->ActivePage = 0;                         // and back to the first page
      cxSpreadBookSetSelection(NULL, cxSpreadBook->ActiveSheet);     // call to set the current cell and cell contents display
    }
    __finally {
      cxSpreadBook->EndUpdate();
    }
}
//---------------------------------------------------------------------------

void __fastcall TStocksMainForm::cxSpreadBookSetSelection(TObject *Sender,
      TcxSSBookSheet *ASheet)
{
  TcxSSCellObject *CellObject;
  CellObject = cxSpreadBook->ActiveSheet->GetCellObject(ASheet->SelectionRect.Left, ASheet->SelectionRect.Top);
  try {
    FIsUpdate = true;
    edtCellEdit->Text = CellObject->Text;
    pnCellsRect->Caption = GetCellText(ASheet->SelectionRect, cxSpreadBook->R1C1ReferenceStyle);
  }
  __finally {
    delete CellObject;
    FIsUpdate = false;
  }
}
//---------------------------------------------------------------------------
String __fastcall TStocksMainForm::GetCellText(TRect SelectionRect, bool R1C1)
{
  return cxSpreadBook->CellsNameByRef(cxSpreadBook->ActivePage, SelectionRect, R1C1);
}

void __fastcall TStocksMainForm::actApplyFormattingExecute(TObject *Sender)
{
  TcxSSHeader *CHeader, *RHeader;
  TCursor CurCursor = Screen->Cursor;                       // preserve the current cursor
  Screen->Cursor = crHourGlass;                             // wait cursor
  FIsSaveSpreadSheet = false;
  cxSpreadBook->BeginUpdate();
  try {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲综合在线五月| 亚洲午夜羞羞片| 国产精品久久久99| 亚洲乱码国产乱码精品精的特点 | 99在线精品一区二区三区| 日本美女一区二区| 97超碰欧美中文字幕| 精品美女在线播放| 亚洲在线视频免费观看| 成人黄色在线网站| 久久综合网色—综合色88| 天天色综合天天| 欧洲精品中文字幕| 亚洲欧洲国产日韩| 国产精品一线二线三线| 91精品啪在线观看国产60岁| 欧美精彩视频一区二区三区| 日韩高清不卡一区二区三区| 欧美在线观看视频一区二区| 国产精品天干天干在线综合| 国精品**一区二区三区在线蜜桃| 欧美私模裸体表演在线观看| 一区二区三区在线免费视频| 99九九99九九九视频精品| 国产欧美日韩亚州综合 | 日本一区二区免费在线| 国产一区二区成人久久免费影院| 99精品在线免费| 中文字幕亚洲一区二区va在线| 国产一区二区三区免费播放| 日韩一区二区三区在线观看| 日本女优在线视频一区二区| 91精品国产全国免费观看| 亚洲成人激情综合网| 欧美日韩国产一二三| 亚洲最色的网站| 欧美日韩精品一区二区在线播放 | 91国产精品成人| 亚洲精品成人少妇| 在线一区二区三区四区| 亚洲人成影院在线观看| 日韩欧美一二三| 美国一区二区三区在线播放| 欧美电视剧在线看免费| 国产一区二区三区四区五区入口| 国产亚洲精品福利| 成人免费毛片aaaaa**| 日本一二三不卡| 一本大道久久精品懂色aⅴ| 亚洲自拍偷拍麻豆| 日韩视频免费观看高清完整版在线观看| 首页亚洲欧美制服丝腿| 欧美变态口味重另类| 国产成人综合亚洲91猫咪| 国产精品久久夜| 欧美日韩一区二区三区在线看| 日韩中文欧美在线| 久久夜色精品国产欧美乱极品| 粉嫩嫩av羞羞动漫久久久| 一区二区三区小说| 日韩欧美一级二级| www.66久久| 日韩精品成人一区二区在线| 国产天堂亚洲国产碰碰| 91久久精品一区二区三| 久久精品国产成人一区二区三区| 国产视频一区二区三区在线观看| 99久久99久久免费精品蜜臀| 奇米888四色在线精品| 久久久另类综合| 欧美在线视频日韩| 国产精品一二三区在线| 亚洲国产精品自拍| 26uuu国产一区二区三区 | 九一久久久久久| 亚洲区小说区图片区qvod| 日韩视频免费观看高清在线视频| 99re视频精品| 激情深爱一区二区| 亚洲一区二区在线观看视频| 国产亚洲欧美日韩俺去了| 欧美日韩一区高清| 岛国一区二区在线观看| 日本不卡高清视频| 亚洲精品乱码久久久久久黑人| 久久夜色精品国产噜噜av | 欧美一区永久视频免费观看| 成人动漫在线一区| 免费久久精品视频| 亚洲影院在线观看| 成人免费在线播放视频| 久久青草欧美一区二区三区| 宅男噜噜噜66一区二区66| 色94色欧美sute亚洲13| 成人av电影在线观看| 精品在线播放免费| 日韩中文欧美在线| 亚洲成a人片在线不卡一二三区| **性色生活片久久毛片| 日韩精品1区2区3区| 亚洲欧美日韩综合aⅴ视频| 国产午夜精品福利| 久久久久久久久久久久久女国产乱| 91精品国产综合久久香蕉麻豆| 欧洲中文字幕精品| 日本韩国一区二区三区| 99国内精品久久| 成人免费三级在线| 国产91色综合久久免费分享| 国产一区二区在线影院| 久久成人综合网| 极品少妇xxxx精品少妇| 激情文学综合网| 韩国中文字幕2020精品| 国产自产高清不卡| 国产精品资源站在线| 国产精品 欧美精品| 国产黄人亚洲片| 国产精品1区二区.| 成人免费看的视频| av在线不卡电影| 欧美亚男人的天堂| 777奇米成人网| 欧美成人性战久久| 久久久久综合网| 国产精品视频你懂的| 亚洲私人黄色宅男| 亚洲成人动漫av| 免费看日韩精品| 国产高清视频一区| www.日韩精品| 欧美色国产精品| 91精品欧美福利在线观看| 日韩免费性生活视频播放| 久久久国产一区二区三区四区小说 | 播五月开心婷婷综合| 91麻豆免费视频| 制服丝袜av成人在线看| 欧美成人一区二区三区在线观看| 精品国产第一区二区三区观看体验| 久久综合资源网| 国产精品黄色在线观看| 亚洲成人av资源| 国产一区二区日韩精品| 色美美综合视频| 日韩三级高清在线| 中文字幕中文在线不卡住| 亚洲第一福利视频在线| 国内欧美视频一区二区| 久久精品欧美日韩精品 | 天涯成人国产亚洲精品一区av| 男人操女人的视频在线观看欧美| 国产河南妇女毛片精品久久久| 色综合久久九月婷婷色综合| 欧美一区二区三级| 国产精品高潮呻吟久久| 日韩精品成人一区二区在线| 成人av网站免费观看| 欧美精品日韩一本| 国产精品高潮呻吟| 麻豆一区二区三| 91欧美一区二区| 久久久久久亚洲综合影院红桃| 亚洲精品国产精品乱码不99| 激情国产一区二区| 一本高清dvd不卡在线观看| 精品久久国产97色综合| 亚洲综合男人的天堂| 国产ts人妖一区二区| 91精品国产色综合久久久蜜香臀| 中文字幕一区二区三区在线观看| 日韩国产欧美一区二区三区| 99re成人精品视频| 精品国产乱码久久久久久浪潮 | 日本精品视频一区二区| 国产视频不卡一区| 日本在线不卡视频| 欧美伊人久久久久久午夜久久久久| 久久看人人爽人人| 五月激情综合婷婷| 91免费精品国自产拍在线不卡 | 在线不卡一区二区| 一区二区在线观看av| 福利一区在线观看| 久久一区二区三区国产精品| 首页综合国产亚洲丝袜| 色婷婷久久久亚洲一区二区三区 | 日韩欧美123| 日韩中文欧美在线| 欧美日韩在线直播| 亚洲综合激情小说| 91影视在线播放| 亚洲欧美一区二区视频| 成人午夜av在线| 欧美国产日韩精品免费观看| 国产精品99久久久久久宅男| 久久品道一品道久久精品| 国产一区二区三区蝌蚪| 国产亚洲污的网站| 国产成人av自拍|