Browse Source

UIMessage Dialog hinzugefügt

Kolja Strohm 5 years ago
parent
commit
62cc6cddc5
8 changed files with 173 additions and 71 deletions
  1. 15 15
      DX12PixelShader.h
  2. 21 21
      DX12VertexShader.h
  3. 2 0
      Framework.vcxproj
  4. 6 0
      Framework.vcxproj.filters
  5. 73 0
      UIDialog.cpp
  6. 21 0
      UIDialog.h
  7. 16 16
      UIPixelShader.h
  8. 19 19
      UIVertexShader.h

+ 15 - 15
DX12PixelShader.h

@@ -92,10 +92,10 @@ ret
 
 const BYTE DX12PixelShaderBytes[] =
 {
-     68,  88,  66,  67,  99,  35, 
-    117, 174,  60,  32,  37, 186, 
-    120,  13, 222,  38, 125,  80, 
-    159, 110,   1,   0,   0,   0, 
+     68,  88,  66,  67, 237, 196, 
+    223, 174, 151,  80, 186,  63, 
+    226,   3,  42, 117, 160, 119, 
+    105, 181,   1,   0,   0,   0, 
     184,  91,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
      36,   2,   0,   0, 188,   2, 
@@ -763,11 +763,11 @@ const BYTE DX12PixelShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0, 148,  46, 
-     49,   1, 114, 208, 119,  92, 
-      1,   0,   0,   0, 238, 247, 
-     46, 207, 201, 186, 199,  79, 
-    138, 248, 190, 253, 211, 255, 
-    109,  80,   0,   0,   0,   0, 
+     49,   1, 139,  74, 121,  92, 
+      1,   0,   0,   0,  36, 167, 
+     10,  74,  91, 184,  92,  64, 
+    150,  23,  54, 100, 248, 146, 
+    211, 135,   0,   0,   0,   0, 
       0,   0,   0,   0,   1,   0, 
       0,   0,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -1788,7 +1788,7 @@ const BYTE DX12PixelShaderBytes[] =
      32,  32,  32,  32,  32,  32, 
      32,  32,  32,  32,  27, 226, 
      48,   1, 128,   0,   0,   0, 
-     94, 142,  31,   9,  95, 207, 
+    200,  73,  60, 102,  64, 208, 
     212,   1,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -3427,7 +3427,7 @@ const BYTE DX12PixelShaderBytes[] =
       2,   0,   9,   0, 220,   4, 
       0,   0,   0,   0,   0,   0, 
     156,   1,   0,   0,   1,   0, 
-      0,   0, 120, 122,  72,   3, 
+      0,   0, 120, 123, 147,   3, 
       0,   0,   0,   0,   0,   0, 
       0,   0, 109,  97, 105, 110, 
       0, 110, 111, 110, 101,   0, 
@@ -3494,10 +3494,10 @@ const BYTE DX12PixelShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0, 148,  46,  49,   1, 
-    114, 208, 119,  92,   1,   0, 
-      0,   0, 238, 247,  46, 207, 
-    201, 186, 199,  79, 138, 248, 
-    190, 253, 211, 255, 109,  80, 
+    139,  74, 121,  92,   1,   0, 
+      0,   0,  36, 167,  10,  74, 
+     91, 184,  92,  64, 150,  23, 
+     54, 100, 248, 146, 211, 135, 
     137,   0,   0,   0,  47,  76, 
     105, 110, 107,  73, 110, 102, 
     111,   0,  47, 110,  97, 109, 

+ 21 - 21
DX12VertexShader.h

@@ -129,10 +129,10 @@ ret
 
 const BYTE DX12VertexShaderBytes[] =
 {
-     68,  88,  66,  67, 201,  27, 
-    159,  26, 251, 112, 211,  98, 
-    108, 116, 231, 205,  62,  63, 
-    162,   7,   1,   0,   0,   0, 
+     68,  88,  66,  67,  85,  70, 
+    119, 160, 178,  96,  23,  95, 
+    191,  18, 238, 206, 222, 201, 
+    249, 116,   1,   0,   0,   0, 
     108,  78,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
     124,   2,   0,   0,  16,   3, 
@@ -915,11 +915,11 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-    148,  46,  49,   1, 114, 208, 
-    119,  92,   1,   0,   0,   0, 
-    239, 243, 204, 150,  75, 190, 
-    102,  79, 182,  88, 133,  46, 
-     18, 196, 251,  31,   0,   0, 
+    148,  46,  49,   1, 139,  74, 
+    121,  92,   1,   0,   0,   0, 
+    174,  62, 213,  38,  15,  73, 
+    138,  76, 189,  16, 177, 193, 
+    186,  42, 104, 114,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       1,   0,   0,   0,   1,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -1095,7 +1095,7 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0, 103, 159,   1,   0, 
     179, 120,   1,   0, 238,  97, 
       2,   0,  90,  28,   0,   0, 
-      8,  85,   1,   0,  53, 174, 
+    165,  88,   3,   0,  53, 174, 
       3,   0, 206,  21,   0,   0, 
     193, 205,   3,   0, 207, 193, 
       1,   0,  62,   3,   3,   0, 
@@ -1684,8 +1684,8 @@ const BYTE DX12VertexShaderBytes[] =
     111, 110,  59,  13,  10, 125, 
      59,  13,  10,  13,  10,  47, 
      27, 226,  48,   1, 128,   0, 
-      0,   0,   3, 158,  92,   9, 
-     95, 207, 212,   1,   1,   0, 
+      0,   0, 140,  25, 124, 102, 
+     64, 208, 212,   1,   1,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -2200,7 +2200,7 @@ const BYTE DX12VertexShaderBytes[] =
      12,  16,   0,   0,   1,   0, 
       1,   0,  14,   0,  23,  21, 
      13,  16,   0,   0,  36,   2, 
-    128, 123,   0,   0, 242, 241, 
+    176, 123,   0,   0, 242, 241, 
      10,   0,  24,  21,  14,  16, 
       0,   0,   1,   0,   0,   2, 
      18,   0,  22,  21,  10,  16, 
@@ -3148,19 +3148,19 @@ const BYTE DX12VertexShaderBytes[] =
       1,   0,   0,   0,   0,   0, 
       0,   0,  24,   4,   0,   0, 
      32,   0,   0,  96,   0,   0, 
-    251,  31,   0,   0,   0,   0, 
+      0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   2,   0, 
       9,   0, 132,   5,   0,   0, 
       0,   0,   0,   0, 236,   2, 
       0,   0,   1,   0,   0,   0, 
-     56, 122,  67,   3,   0,   0, 
+    104, 123,  91,   3,   0,   0, 
       0,   0,   0,   0,   0,   0, 
     109,  97, 105, 110,   0, 110, 
     111, 110, 101,   0,   0,   0, 
      45, 186,  46, 241,   1,   0, 
       0,   0,   0,   0,   0,   0, 
      24,   4,   0,   0,  32,   0, 
-      0,  96,   0,   0, 251,  31, 
+      0,  96,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   2,   0,   2,   0, 
       7,   0,   0,   0,   0,   0, 
@@ -3219,11 +3219,11 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-    148,  46,  49,   1, 114, 208, 
-    119,  92,   1,   0,   0,   0, 
-    239, 243, 204, 150,  75, 190, 
-    102,  79, 182,  88, 133,  46, 
-     18, 196, 251,  31, 138,   0, 
+    148,  46,  49,   1, 139,  74, 
+    121,  92,   1,   0,   0,   0, 
+    174,  62, 213,  38,  15,  73, 
+    138,  76, 189,  16, 177, 193, 
+    186,  42, 104, 114, 138,   0, 
       0,   0,  47,  76, 105, 110, 
     107,  73, 110, 102, 111,   0, 
      47, 110,  97, 109, 101, 115, 

+ 2 - 0
Framework.vcxproj

@@ -235,6 +235,7 @@ copy "x64\Release\Framework.dll" "..\..\Spiele Platform\SMP\Fertig\x64\framework
     <ClInclude Include="Mat4.h" />
     <ClInclude Include="Maus.h" />
     <ClInclude Include="MausEreignis.h" />
+    <ClInclude Include="UIDialog.h" />
     <ClInclude Include="Model2D.h" />
     <ClInclude Include="M2DVorschau.h" />
     <ClInclude Include="Model3D.h" />
@@ -323,6 +324,7 @@ copy "x64\Release\Framework.dll" "..\..\Spiele Platform\SMP\Fertig\x64\framework
     <ClCompile Include="Textur2D.cpp" />
     <ClCompile Include="TexturList.cpp" />
     <ClCompile Include="TexturModel.cpp" />
+    <ClCompile Include="UIDialog.cpp" />
     <ClCompile Include="UIInitialization.cpp" />
     <ClCompile Include="UIMLView.cpp" />
     <ClCompile Include="Welt2D.cpp" />

+ 6 - 0
Framework.vcxproj.filters

@@ -318,6 +318,9 @@
     <ClInclude Include="DXCommandQueue.h">
       <Filter>Headerdateien\Framework\Grafik\DX</Filter>
     </ClInclude>
+    <ClInclude Include="UIDialog.h">
+      <Filter>Headerdateien\Framework\Objekte2D</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="Maus.cpp">
@@ -518,6 +521,9 @@
     <ClCompile Include="DXCommandQueue.cpp">
       <Filter>Quelldateien\Framework\Grafik\DX</Filter>
     </ClCompile>
+    <ClCompile Include="UIDialog.cpp">
+      <Filter>Quelldateien\Framework\Objekte2D</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <FxCompile Include="DX12VertexShader.hlsl">

+ 73 - 0
UIDialog.cpp

@@ -0,0 +1,73 @@
+#include "UIDialog.h"
+#include "UIInitialization.h"
+#include "TextFeld.h"
+#include "Schrift.h"
+#include "Knopf.h"
+
+using namespace Framework;
+
+UIDialog::UIDialog( Schrift *schrift )
+    : Fenster()
+{
+    setStyle( Fenster::Style::normal | Fenster::Style::BodyHintergrund | Fenster::Style::TitelHintergrund | Fenster::Style::ClosingHintergrund );
+    setKBgFarbe( 0xFF000000 );
+    setTBgFarbe( 0xFF000000 );
+    setSBgFarbe( 0xFF000000 );
+    setMausEreignis( _ret1ME );
+    setTastaturEreignis( _ret1TE );
+    setRBreite( 1 );
+    setRFarbe( 0xFFFFFFFF );
+    setTitel( "" );
+    setTSchriftZ( schrift );
+    setTSFarbe( 0xFFFFFFFF );
+    zTTextFeld()->setSize( 0, 20 );
+    zTTextFeld()->addStyle( TextFeld::Style::Sichtbar | TextFeld::Style::Center | TextFeld::Style::Rahmen );
+    setTRFarbe( 0xFF00FF00 );
+    setTRBreite( 1 );
+    setTAfFarbe( 0x1000FF00 );
+    setTAfStrength( -15 );
+    setSKAfFarbe( 0xFF00FF00 );
+    setSKAfStrength( 30 );
+    setClosingMe( [ this ]( void *p, void *o, MausEreignis me )
+    {
+        if( me.id == ME_RLinks )
+            removeStyle( Fenster::Style::Sichtbar );
+        return 1;
+    } );
+}
+
+UIDialog::~UIDialog()
+{}
+
+
+UIMessageDialog::UIMessageDialog( const char *titel, const char *message, Schrift *schrift )
+    : UIDialog( schrift )
+{
+    setTitel( titel );
+    UIInit init = defaultUI( schrift, 0 );
+    TextFeld *msg = init.createTextFeld( init.initParam );
+    msg->setStyle( TextFeld::Style::Text );
+    msg->setText( message );
+    msg->setPosition( 5, 5 );
+    TextRenderer tr( schrift->getThis() );
+    tr.textFormatieren( msg->zText(), 590 );
+    int br = tr.getTextBreite( message );
+    int hö = tr.getTextHeight( message );
+    msg->setSize( br, hö );
+    Knopf *ok = init.createKnopf( init.initParam );
+    ok->setText( "Ok" );
+    ok->setMausEreignis( [ this ]( void *p, void *o, MausEreignis me )
+    {
+        if( me.id == ME_RLinks )
+            removeStyle( Fenster::Style::Sichtbar );
+        return 1;
+    } );
+    ok->setPosition( br - 100, hö + 5 );
+    ok->setSize( 100, 20 );
+    addMember( ok );
+    addMember( msg );
+    setSize( br + 10, hö + 55 );
+}
+
+UIMessageDialog::~UIMessageDialog()
+{}

+ 21 - 0
UIDialog.h

@@ -0,0 +1,21 @@
+#pragma once
+
+#include "Fenster.h"
+
+namespace Framework
+{
+    class UIDialog : public Fenster
+    {
+    public:
+        __declspec( dllexport ) UIDialog( Schrift *schrift );
+        __declspec( dllexport ) virtual ~UIDialog();
+    };
+
+    class UIMessageDialog : public UIDialog
+    {
+    public:
+        __declspec( dllexport ) UIMessageDialog( const char *titel, const char *message, Schrift *schrift );
+        __declspec( dllexport ) virtual ~UIMessageDialog();
+    };
+
+}

+ 16 - 16
UIPixelShader.h

@@ -262,10 +262,10 @@ ret
 
 const BYTE UIPixelShader[] =
 {
-     68,  88,  66,  67, 165,  20, 
-    193,  31,  46, 135,  50, 132, 
-    186,  35, 247, 116,  13, 110, 
-    131, 186,   1,   0,   0,   0, 
+     68,  88,  66,  67, 180, 219, 
+    247,  53, 144,  55,  43,  46, 
+     41, 148, 254,   3, 127,   2, 
+    166, 210,   1,   0,   0,   0, 
     136, 104,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
     124,   5,   0,   0,  12,   6, 
@@ -1480,10 +1480,10 @@ const BYTE UIPixelShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0, 148,  46,  49,   1, 
-    114, 208, 119,  92,   1,   0, 
-      0,   0,  13, 121, 218,  52, 
-    128, 202, 104,  71, 137,  27, 
-     45, 100,  19, 239,  86, 197, 
+    139,  74, 121,  92,   1,   0, 
+      0,   0,   3, 109,  18,   7, 
+    124, 164, 255,  64, 149, 206, 
+     70, 129, 132, 102, 180, 190, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   1,   0,   0,   0, 
       1,   0,   0,   0,   0,   0, 
@@ -2419,8 +2419,8 @@ const BYTE UIPixelShader[] =
      32,  32,  32,  32,  32,  32, 
      32,  32,  32,  32,  32,  32, 
      27, 226,  48,   1, 128,   0, 
-      0,   0,  83,   9, 129,   9, 
-     95, 207, 212,   1,   1,   0, 
+      0,   0, 186,  42, 167, 102, 
+     64, 208, 212,   1,   1,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -4400,7 +4400,7 @@ const BYTE UIPixelShader[] =
       9,   0, 160,   7,   0,   0, 
       0,   0,   0,   0, 244,   9, 
       0,   0,   1,   0,   0,   0, 
-    216, 121, 224,   3,   0,   0, 
+    104, 121,  17,   3,   0,   0, 
       0,   0,   0,   0,   0,   0, 
      84, 101, 120, 116, 117, 114, 
     101,  80, 105, 120, 101, 108, 
@@ -4466,11 +4466,11 @@ const BYTE UIPixelShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-    148,  46,  49,   1, 114, 208, 
-    119,  92,   1,   0,   0,   0, 
-     13, 121, 218,  52, 128, 202, 
-    104,  71, 137,  27,  45, 100, 
-     19, 239,  86, 197, 137,   0, 
+    148,  46,  49,   1, 139,  74, 
+    121,  92,   1,   0,   0,   0, 
+      3, 109,  18,   7, 124, 164, 
+    255,  64, 149, 206,  70, 129, 
+    132, 102, 180, 190, 137,   0, 
       0,   0,  47,  76, 105, 110, 
     107,  73, 110, 102, 111,   0, 
      47, 110,  97, 109, 101, 115, 

+ 19 - 19
UIVertexShader.h

@@ -119,10 +119,10 @@ ret
 
 const BYTE UIVertexShader[] =
 {
-     68,  88,  66,  67, 248, 132, 
-    114, 150, 134,  87,  43, 137, 
-    106, 208,  68, 239, 161,  92, 
-     78,  84,   1,   0,   0,   0, 
+     68,  88,  66,  67, 155,  78, 
+     31,  52, 183, 148, 206, 206, 
+      8, 126,  16,  97,   1, 179, 
+    136, 201,   1,   0,   0,   0, 
     168,  77,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
      20,   2,   0,   0, 168,   2, 
@@ -873,10 +873,10 @@ const BYTE UIVertexShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0, 148,  46,  49,   1, 
-    115, 208, 119,  92,   1,   0, 
-      0,   0, 180,  24, 238, 137, 
-    214, 102,   7,  72, 140, 217, 
-    238, 110,  86,  86, 195, 139, 
+    140,  74, 121,  92,   1,   0, 
+      0,   0, 116, 101,  70, 200, 
+    168,  31,  86,  71, 184,   8, 
+     85,   4, 200, 196, 113, 216, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   1,   0,   0,   0, 
       1,   0,   0,   0,   0,   0, 
@@ -1556,8 +1556,8 @@ const BYTE UIVertexShader[] =
      32,  32,  32,  32,  32,  32, 
      32,  32,  32,  32,  32,  32, 
      27, 226,  48,   1, 128,   0, 
-      0,   0, 248,  57, 192,   9, 
-     95, 207, 212,   1,   1,   0, 
+      0,   0,  15, 246, 234, 102, 
+     64, 208, 212,   1,   1,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -2934,13 +2934,13 @@ const BYTE UIVertexShader[] =
       0,   0,   0,   0,   1,   0, 
       0,   0,   0,   0,   0,   0, 
     196,   3,   0,   0,  32,   0, 
-      0,  96,   0,   0, 195, 139, 
+      0,  96,   0,   0, 113, 216, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   2,   0,   9,   0, 
      80,   5,   0,   0,   0,   0, 
       0,   0, 236,   2,   0,   0, 
-      1,   0,   0,   0, 248, 122, 
-    169,   3,   0,   0,   0,   0, 
+      1,   0,   0,   0, 120, 120, 
+     55,   3,   0,   0,   0,   0, 
       0,   0,   0,   0,  84, 101, 
     120, 116, 117, 114, 101,  86, 
     101, 114, 116, 101, 120,  83, 
@@ -2950,7 +2950,7 @@ const BYTE UIVertexShader[] =
       1,   0,   0,   0,   0,   0, 
       0,   0, 196,   3,   0,   0, 
      32,   0,   0,  96,   0,   0, 
-    195, 139,   0,   0,   0,   0, 
+    113, 216,   0,   0,   0,   0, 
       0,   0,   0,   0,   2,   0, 
       2,   0,   7,   0,   0,   0, 
       0,   0,   1,   0, 255, 255, 
@@ -3006,11 +3006,11 @@ const BYTE UIVertexShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0, 148,  46, 
-     49,   1, 115, 208, 119,  92, 
-      1,   0,   0,   0, 180,  24, 
-    238, 137, 214, 102,   7,  72, 
-    140, 217, 238, 110,  86,  86, 
-    195, 139, 138,   0,   0,   0, 
+     49,   1, 140,  74, 121,  92, 
+      1,   0,   0,   0, 116, 101, 
+     70, 200, 168,  31,  86,  71, 
+    184,   8,  85,   4, 200, 196, 
+    113, 216, 138,   0,   0,   0, 
      47,  76, 105, 110, 107,  73, 
     110, 102, 111,   0,  47, 110, 
      97, 109, 101, 115,   0,  47,