From 84d1f79fdf02e0010e4b2d118458e8cd8ce0dd71 Mon Sep 17 00:00:00 2001 From: Krzysztof H Date: Fri, 9 Mar 2012 17:08:05 +0100 Subject: Added license info using a small program SrcHead. --- src/window.cpp | 90 +++++++++++++++++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 38 deletions(-) (limited to 'src/window.cpp') diff --git a/src/window.cpp b/src/window.cpp index 1740919..3e8cbf5 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1,4 +1,18 @@ -// window.cpp +// * This file is part of the COLOBOT source code +// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * +// * This program is free software: you can redistribute it and/or modify +// * it under the terms of the GNU General Public License as published by +// * the Free Software Foundation, either version 3 of the License, or +// * (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have received a copy of the GNU General Public License +// * along with this program. If not, see . #define STRICT #define D3D_OVERLOADS @@ -80,7 +94,7 @@ CWindow::~CWindow() } -// Purge tous les contrôles. +// Purge tous les contr�les. void CWindow::Flush() { @@ -115,7 +129,7 @@ void CWindow::Flush() } -// Crée une nouvelle fenêtre. +// Cr�e une nouvelle fen�tre. BOOL CWindow::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) { @@ -126,7 +140,7 @@ BOOL CWindow::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) } -// Crée un nouveau bouton. +// Cr�e un nouveau bouton. CButton* CWindow::CreateButton(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) { @@ -148,7 +162,7 @@ CButton* CWindow::CreateButton(FPOINT pos, FPOINT dim, int icon, EventMsg eventM return 0; } -// Crée un nouveau bouton. +// Cr�e un nouveau bouton. CColor* CWindow::CreateColor(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) { @@ -170,7 +184,7 @@ CColor* CWindow::CreateColor(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg return 0; } -// Crée un nouveau bouton. +// Cr�e un nouveau bouton. CCheck* CWindow::CreateCheck(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) { @@ -192,7 +206,7 @@ CCheck* CWindow::CreateCheck(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg return 0; } -// Crée un nouveau bouton. +// Cr�e un nouveau bouton. CKey* CWindow::CreateKey(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) { @@ -214,7 +228,7 @@ CKey* CWindow::CreateKey(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) return 0; } -// Crée un nouveau bouton. +// Cr�e un nouveau bouton. CGroup* CWindow::CreateGroup(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) { @@ -236,7 +250,7 @@ CGroup* CWindow::CreateGroup(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg return 0; } -// Crée un nouveau bouton. +// Cr�e un nouveau bouton. CImage* CWindow::CreateImage(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) { @@ -258,7 +272,7 @@ CImage* CWindow::CreateImage(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg return 0; } -// Crée un nouveau label. +// Cr�e un nouveau label. CLabel* CWindow::CreateLabel(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg, char *name) @@ -289,7 +303,7 @@ CLabel* CWindow::CreateLabel(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg text[100-1] = 0; if ( p-name < 100 ) { - text[p-name] = 0; // supprime texte après "\\" (tooltip) + text[p-name] = 0; // supprime texte apr�s "\\" (tooltip) } pc->SetName(text); } @@ -299,7 +313,7 @@ CLabel* CWindow::CreateLabel(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg return 0; } -// Crée un nouveau pavé éditable. +// Cr�e un nouveau pav� �ditable. CEdit* CWindow::CreateEdit(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) { @@ -321,7 +335,7 @@ CEdit* CWindow::CreateEdit(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) return 0; } -// Crée un nouveau pavé éditable. +// Cr�e un nouveau pav� �ditable. CEditValue* CWindow::CreateEditValue(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) { @@ -343,7 +357,7 @@ CEditValue* CWindow::CreateEditValue(FPOINT pos, FPOINT dim, int icon, EventMsg return 0; } -// Crée un nouvel ascenseur. +// Cr�e un nouvel ascenseur. CScroll* CWindow::CreateScroll(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) { @@ -365,7 +379,7 @@ CScroll* CWindow::CreateScroll(FPOINT pos, FPOINT dim, int icon, EventMsg eventM return 0; } -// Crée un nouveau curseur. +// Cr�e un nouveau curseur. CSlider* CWindow::CreateSlider(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) { @@ -387,7 +401,7 @@ CSlider* CWindow::CreateSlider(FPOINT pos, FPOINT dim, int icon, EventMsg eventM return 0; } -// Crée une nouvelle liste. +// Cr�e une nouvelle liste. CList* CWindow::CreateList(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg, float expand) @@ -410,7 +424,7 @@ CList* CWindow::CreateList(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg, return 0; } -// Crée un nouveau raccourci. +// Cr�e un nouveau raccourci. CShortcut* CWindow::CreateShortcut(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) { @@ -432,7 +446,7 @@ CShortcut* CWindow::CreateShortcut(FPOINT pos, FPOINT dim, int icon, EventMsg ev return 0; } -// Crée une nouvelle carte. +// Cr�e une nouvelle carte. CMap* CWindow::CreateMap(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) { @@ -454,7 +468,7 @@ CMap* CWindow::CreateMap(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) return 0; } -// Crée une nouvelle jauge. +// Cr�e une nouvelle jauge. CGauge* CWindow::CreateGauge(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) { @@ -476,7 +490,7 @@ CGauge* CWindow::CreateGauge(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg return 0; } -// Crée une nouvelle boussole. +// Cr�e une nouvelle boussole. CCompass* CWindow::CreateCompass(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) { @@ -498,7 +512,7 @@ CCompass* CWindow::CreateCompass(FPOINT pos, FPOINT dim, int icon, EventMsg even return 0; } -// Crée une nouvelle cible. +// Cr�e une nouvelle cible. CTarget* CWindow::CreateTarget(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg) { @@ -520,7 +534,7 @@ CTarget* CWindow::CreateTarget(FPOINT pos, FPOINT dim, int icon, EventMsg eventM return 0; } -// Supprime un contrôle. +// Supprime un contr�le. BOOL CWindow::DeleteControl(EventMsg eventMsg) { @@ -541,7 +555,7 @@ BOOL CWindow::DeleteControl(EventMsg eventMsg) return FALSE; } -// Donne un contrôle. +// Donne un contr�le. CControl* CWindow::SearchControl(EventMsg eventMsg) { @@ -561,7 +575,7 @@ CControl* CWindow::SearchControl(EventMsg eventMsg) } -// Donne le tooltip lié à la fenêtre. +// Donne le tooltip li� � la fen�tre. BOOL CWindow::GetTooltip(FPOINT pos, char* name) { @@ -594,7 +608,7 @@ BOOL CWindow::GetTooltip(FPOINT pos, char* name) return TRUE; } - if ( Detect(pos) ) // dans la fenêtre ? + if ( Detect(pos) ) // dans la fen�tre ? { strcpy(name, m_tooltip); return TRUE; @@ -604,7 +618,7 @@ BOOL CWindow::GetTooltip(FPOINT pos, char* name) } -// Spécifie le nom pour la barre de titre. +// Sp�cifie le nom pour la barre de titre. void CWindow::SetName(char* name) { @@ -742,7 +756,7 @@ FPOINT CWindow::RetMaxDim() } -// Indique si la fenêtre est déplaçable. +// Indique si la fen�tre est d�pla�able. void CWindow::SetMovable(BOOL bMode) { @@ -755,7 +769,7 @@ BOOL CWindow::RetMovable() } -// Gestion de la présence des boutons minimise/maximise. +// Gestion de la pr�sence des boutons minimise/maximise. void CWindow::SetRedim(BOOL bMode) { @@ -768,7 +782,7 @@ BOOL CWindow::RetRedim() } -// Gestion de la présence du bouton de fermeture. +// Gestion de la pr�sence du bouton de fermeture. void CWindow::SetClosable(BOOL bMode) { @@ -897,9 +911,9 @@ EventMsg CWindow::RetEventMsgClose() } -// Détecte si la souris est dans un bord de la fenêtre, pour +// D�tecte si la souris est dans un bord de la fen�tre, pour // la redimensionner. -// Bits retournée: 0=gauche, 1=bas, 2=droite, 3=haut, -1=tout. +// Bits retourn�e: 0=gauche, 1=bas, 2=droite, 3=haut, -1=tout. int CWindow::BorderDetect(FPOINT pos) { @@ -950,7 +964,7 @@ int CWindow::BorderDetect(FPOINT pos) return flags; } -// Gestion d'un événement. +// Gestion d'un �v�nement. BOOL CWindow::EventProcess(const Event &event) { @@ -1049,7 +1063,7 @@ BOOL CWindow::EventProcess(const Event &event) if ( event.event == EVENT_MOUSEMOVE && m_bCapture ) { pos = event.pos; - if ( m_pressFlags == -1 ) // déplace tout ? + if ( m_pressFlags == -1 ) // d�place tout ? { m_pos.x += pos.x-m_pressPos.x; m_pos.y += pos.y-m_pressPos.y; @@ -1108,7 +1122,7 @@ BOOL CWindow::EventProcess(const Event &event) } -// Dessine la fenêtre. +// Dessine la fen�tre. void CWindow::Draw() { @@ -1206,7 +1220,7 @@ void CWindow::DrawVertex(FPOINT pos, FPOINT dim, int icon) { m_engine->SetTexture("button2.tga"); m_engine->SetState(D3DSTATETTw); - uv1.x = 64.0f/256.0f; // bleu foncé transparent + uv1.x = 64.0f/256.0f; // bleu fonc� transparent uv1.y = 64.0f/256.0f; uv2.x = 128.0f/256.0f; uv2.y = 128.0f/256.0f; @@ -1250,7 +1264,7 @@ void CWindow::DrawVertex(FPOINT pos, FPOINT dim, int icon) { m_engine->SetTexture("button2.tga"); m_engine->SetState(D3DSTATETTb); - uv1.x = 0.0f/256.0f; // bleu transparent avec barre jaune supérieure + uv1.x = 0.0f/256.0f; // bleu transparent avec barre jaune sup�rieure uv1.y = 64.0f/256.0f; uv2.x = 64.0f/256.0f; uv2.y = 128.0f/256.0f; @@ -1277,7 +1291,7 @@ void CWindow::DrawVertex(FPOINT pos, FPOINT dim, int icon) uv1.y += dp; uv2.x -= dp; uv2.y -= dp; - DrawIcon(pos, dim, uv1, uv2); // vêtement + DrawIcon(pos, dim, uv1, uv2); // v�tement pos.x += 20.0f/640.0f; pos.y -= 10.0f/480.0f; @@ -1348,7 +1362,7 @@ void CWindow::DrawVertex(FPOINT pos, FPOINT dim, int icon) uv1.y += dp; uv2.x -= dp; uv2.y -= dp; - DrawIcon(pos, dim, uv1, uv2); // fond bleu foncé + DrawIcon(pos, dim, uv1, uv2); // fond bleu fonc� m_engine->SetTexture("button2.tga"); uv1.x = 224.0f/256.0f; -- cgit v1.2.3-1-g7c22