Ignore:
Timestamp:
Jun 16, 2010, 8:23:07 PM (14 years ago)
Author:
Kevin Toppenberg
Message:

Bug fixes. Improved Adding Image

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/branches/tmg-cprs/CPRS-Chart/fNotes.pas

    r800 r801  
    180180    btnTextColor: TSpeedButton;            //kt 8/09
    181181    btnBackColor: TSpeedButton;            //kt 8/09
    182     btnImage: TSpeedButton;                //kt 4/10
     182    btnImage: TSpeedButton;
     183    popupAddImage: TPopupMenu;
     184    mnuSelectExistingImage: TMenuItem;
     185    mnuAddNewImage: TMenuItem;                //kt 4/10
    183186    procedure mnuChartTabClick(Sender: TObject);
    184187    procedure lstNotesClick(Sender: TObject);
     
    289292    procedure cbFontSizeChange(Sender: TObject);     //kt 8/09
    290293    procedure btnImageClick(Sender: TObject);        //kt 4/10
    291     procedure popNoteMemoHTMLFormatClick(Sender: TObject); //kt 8/09
     294    procedure popNoteMemoHTMLFormatClick(Sender: TObject);
     295    procedure mnuAddNewImageClick(Sender: TObject);
     296    procedure mnuSelectExistingImageClick(Sender: TObject); //kt 8/09
    292297  private
    293298    FNavigatingTab : Boolean; //Currently Using tab to navigate
     
    401406     //fImages, {//kt added 9-20-05}
    402407     fOptionsNotes, //kt 8/09
     408     fImagePickExisting, //kt 6/16/10
    403409     rHTMLTools, fImages, UploadImages;  {//kt added 5-27-05 for IsHTMLDocument}
    404410
     
    46404646procedure TfrmNotes.btnImageClick(Sender: TObject);
    46414647//kt added function
     4648begin
     4649  if frmImages.ImagesCount > 0 then begin
     4650    popupAddImage.Popup(Mouse.CursorPos.X, Mouse.CursorPos.Y);
     4651    //Will allow user to :
     4652    //  Cancel, or trigger mnuAddNewImageClick or mnuSelectExistingImageClick
     4653  end else begin
     4654    mnuAddNewImageClick(self);
     4655  end;
     4656end;
     4657
     4658procedure TfrmNotes.mnuAddNewImageClick(Sender: TObject);
     4659//kt added function
    46424660var
    46434661   i, AddResult: integer;
     
    46564674   end;
    46574675end;
     4676
     4677procedure TfrmNotes.mnuSelectExistingImageClick(Sender: TObject);
     4678//kt added function
     4679var
     4680  oneImage: string;
     4681  ImageFName : string;
     4682begin
     4683  inherited;
     4684  frmImagePickExisting := TfrmImagePickExisting.Create(Self);
     4685  if frmImagePickExisting.ShowModal = mrOK then begin
     4686    ImageFName := frmImagePickExisting.SelectedImageFName;
     4687    if ImageFName <> '' then begin
     4688      if frmImages.ThumbnailIndexForFName(ImageFName) = IMAGE_INDEX_IMAGE then begin
     4689        oneImage := '<img src="'+ ImageFName + '" ' + ALT_IMG_TAG_CONVERT + ' >';
     4690      end else begin
     4691        oneImage := '<embed src="'+ ImageFName + '" ' + ALT_IMG_TAG_CONVERT + ' >';
     4692      end;
     4693      HTMLEditor.InsertHTMLAtCaret(oneImage+#13#10);
     4694    end;
     4695  end;
     4696  FreeAndNil(frmImagePickExisting);
     4697end;
     4698
    46584699
    46594700procedure TfrmNotes.btnCenterAlignClick(Sender: TObject);
     
    48494890end;
    48504891
     4892
     4893
    48514894initialization
    48524895  uPCEEdit := TPCEData.Create;
Note: See TracChangeset for help on using the changeset viewer.