SingleValueDlg.cpp 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*************************************************************************************************\
  2. HeightDlg.cpp : Implementation of the AssignHeight component. This thing lets you assign
  3. a particular elevation to selected vertices
  4. //---------------------------------------------------------------------------//
  5. // Copyright (C) Microsoft Corporation. All rights reserved. //
  6. //===========================================================================//
  7. \*************************************************************************************************/
  8. #include "SingleValueDlg.h"
  9. #include "resource.h"
  10. #include "mclib.h"
  11. #include "utilities.h"
  12. extern DWORD gameResourceHandle; //Default handle must be used for mc2res.dll due to shared game/editor code
  13. SingleValueDlg::SingleValueDlg( int captionID, int staticTextID, int newVal)
  14. : CDialog( IDD_VALUE )
  15. {
  16. cLoadString( captionID, caption, 256, gameResourceHandle );
  17. cLoadString( staticTextID, staticText, 256, gameResourceHandle );
  18. val = newVal;
  19. }
  20. SingleValueDlg::~SingleValueDlg()
  21. {
  22. }
  23. void SingleValueDlg::Init()
  24. {
  25. char minTxt[256];
  26. itoa( val, minTxt, 10 );
  27. ((CEdit*)GetDlgItem( IDC_HEIGHT ))->SetWindowText( minTxt );
  28. ((CStatic*)GetDlgItem( IDC_TEXT ))->SetWindowText( staticText );
  29. SetWindowText( caption );
  30. }
  31. void SingleValueDlg::OnOK()
  32. {
  33. char wcsMinTxt[256];
  34. ((CEdit*)GetDlgItem( IDC_HEIGHT ))->GetWindowText( wcsMinTxt, 256 );
  35. val = atoi( wcsMinTxt );
  36. CDialog::OnOK();
  37. }
  38. /*void SingleValueDlg::OnCommand(Window *wnd,int nCommand)
  39. {
  40. if (nCommand == BC_CLICKED)
  41. {
  42. wchar_t wcsMinTxt[256];
  43. ((Entry*)GetDlgItem( IDC_HEIGHT ))->GetEntry( wcsMinTxt, 256 );
  44. char minTxt[256];
  45. WcsToStr( minTxt, wcsMinTxt );
  46. val = atoi( minTxt );
  47. szText = 0; // otherwise it will try and free this
  48. EndDialog(wnd->GetID());
  49. Parent()->OnCommand( wnd, ID_OTHER_SELECT );
  50. }
  51. }*/
  52. void SingleValueDlg::Update()
  53. {
  54. char minTxt[256];
  55. itoa( val, minTxt, 10 );
  56. ((CEdit*)GetDlgItem( IDC_HEIGHT ))->SetWindowText( minTxt );
  57. ((CStatic*)GetDlgItem( IDC_TEXT ))->SetWindowText( staticText );
  58. }
  59. //*************************************************************************************************
  60. // end of file ( HeightDlg.cpp )