1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
void __fastcall TfrmPrincipale::StatusBar1DrawPanel(TStatusBar *StatusBar,
TStatusPanel *Panel, const TRect &Rect)
{
TCanvas *pCanva = StatusBar->Canvas;
switch (Panel->Index)
{
case 0:
pCanva->Brush->Color = frmPrincipale->Color;
pCanva->FillRect(Rect);
pCanva->Font->Color = clBlue;
pCanva->Font->Style = TFontStyles();
if (IndexPanelSurvol == 0)
{
StatusBar->Cursor = crHandPoint;
pCanva->Font->Style = TFontStyles() << fsBold << fsUnderline;
}
pCanva->TextRect(Rect, ((Rect.Width() - Panel->Text.Length()) / 4), Rect.Top + 1, Panel->Text);
break;
case 1:
pCanva->Brush->Color = frmPrincipale->Color;
pCanva->FillRect(Rect);
pCanva->Font->Color = clBlack;
pCanva->Font->Style = TFontStyles();
if (AffMaj == true)
{
pCanva->Font->Color = AColor;
pCanva->Font->Style = TFontStyles() << fsBold << fsUnderline;
}
pCanva->TextRect(Rect, Rect.Left + 40, Rect.Top + 1, Panel->Text);
break;
case 2:
pCanva->Brush->Color = frmPrincipale->Color;
pCanva->FillRect(Rect);
pCanva->Font->Color = clRed;
pCanva->Font->Style = TFontStyles();
if (IndexPanelSurvol == 2)
{
StatusBar->Cursor = crHandPoint;
pCanva->Font->Style = TFontStyles() << fsBold << fsUnderline;
}
pCanva->TextRect(Rect, Rect.Left + 60, Rect.Top + 1, Panel->Text);
break;
case 3:
pCanva->Brush->Color = frmPrincipale->Color;
pCanva->FillRect(Rect);
Graphics::TIcon* pIco = new Graphics::TIcon;
pIco->LoadFromFile(CheminAppli + AnsiString("\\Images\\Setting.ico"));
pIco->Transparent = true;
pIco->Height = Rect.Height();
pIco->Width = Rect.Width();
pCanva->Draw(Rect.Left + 15, Rect.Top, pIco);
delete pIco;
break;
}
}
//---------------------------------------------------------------------------
void __fastcall TfrmPrincipale::StatusBar1MouseMove(TObject *Sender,
TShiftState Shift, int X, int Y)
{
if ( X < 200 )
{
StatusBar1->Hint = "Clique droit sur cette zone afin de changer le nom d'utilisateur";
IndexPanelSurvol = 0;//int en private
StatusBar1->Refresh();
}
else
{
if ( X > 200 && X < 400 && frmPrincipale->StatusBar1->Panels->Items[1]->Text == "Fiches a enregistrer !")
{
StatusBar1->Hint = "Clique droit sur cette zone afin de faire défiler la liste des fiches";
IndexPanelSurvol = 1;//int en private
}
else
{
if ( X > 402 && X < 601 )
{
StatusBar1->Hint = "Clique droit sur cette zone afin de faire apparaitre la page des RDV";
IndexPanelSurvol = 2; //int en private
StatusBar1->Refresh();
}
else
{
if ( X > 601 )
{
StatusBar1->Hint = "Clique droit sur cette zone afin de changer le mode de démarrage";
}
}
}
}
} |
Partager