Help, on the modal dialog box under the progress of the issue of synchronization

Started by XDCAD, December 05, 2017, 10:01:55 PM

Previous topic - Next topic

XDCAD

Hello everyone, how to make the LABEL control's CAPTION and progress bar synchronized and clearly displayed。

Demo see animation GIF



(defun c:tt (/)
  (setq XD-ODCL-DATA-PURGEALL '
("YWt6A9ILAABzerQKBuKjKEUxKj9qgJB0tXapuh5yZVVsLjYKc3XS/kh679b+XiwuxMXp6VLxXlTP" "z8rOz8yMWYYyArusNEU1dQF+99zrNtzMAE31CZBivFB7d/cJTQmxSZkPseJHoaIFzs4v9tmu9EjK"
"XfMtXqjdEGB/DLZd93tSHOCMRtCN6Tv4RjfKMhfopEIbcb65VN7kgaTDT06QY5Y8WX3Zlq47jWo5" "7EZeFNmqt3kILKgNY+ITHXRHyg5Qs+dQsOcKdEQc6Nb9aNOKt0/zWt17yrNkEUNBH1wwrlEz1/sN"
"Zx3XOT6VSgud1v7RzRuufO7+jG69mLu5KogP0/UiKXSUQxSBF0gzqnajXenEHSgQ0Gt4KnFvofrg" "sCKDb4bYvsuoASO5hVKKyWLitp9KuK61q3MNih92XWY6fYGZDv8dZDViZxC3ShAN05TL8xGMA1eO"
"Vf8hdoI1ms1SDqINjxElYWM2ozsrJiIj4fgT9YNw6285VltcAQ5CiRHT/BTIxyHbmhWFfXjg6sVi" "YR7vzFIuAOUD8D/7S+4FIm8YJKpxJ4Nl852w3d5UuzQCL70Z3Nng9WRAa4gxegBSjl3/1TvCR1lB"
"AW4pLrFPG7Tv2aK1hVqqy67Rxl2NfLH4lYioCiMY+kBRjiUl2SsTUQlCvPsE8/H1RGFohB/1xVfX" "BRyj6dNA35NJEkDYcKE6ANUfI/SAIbpAAMmVS4ghvaBQnDifASqaBbecMWSJddBzdkJWjjv/yRu6"
"VrCP6mb7FGxFYR82zRi2QHTA/1laPRQ4s3fB+mCingP3OuOlfylcIkbxUyL2c9/BYmFwxxniiFbg" "ERmz1+i9cm11NMy4noH7S5smjD6aZx+3TCLo0t5KNfKDYMyaQCLoMh9pJnyx0/G15FTJrTRPGP+9"
"qbMhHR7tGvJBEsDtWAdRAFeL5lHbjOL3wjHKRLRfLe/h3LyVfAXg9QF2g+S+zM01CiZNCA6QuEJJ" "gUTVcUowJhLgCTrilYziQF3mwvljp3PJXbOFA8lFjOarlbEZr98Ppd/XzFnEwIB8WGkYiw=="
)
  )
  (defun c:XD-P-FORM#OnInitialize (/)
    (dcl-Control-SetValue XD-P-1 0)
  )

  (defun c:XD-P-OK#OnClicked (/)
    (dcl-Control-SetMaxValue XD-P-1 (length dwglst))
    (setq i 1)
    (foreach n dwglst
      (dcl-Control-SetCaption XD-P-TEXT n)
      (dcl-Control-SetValue XD-P-1 i)
;      (dcl-Control-SetCaptionMinute XD-P-1 (itoa i))
      (princ)
      (setq n 1000000)
      (while (> n 0)
(setq n (1- n))
      )
      (setq i (1+ i))
    )
  )
  (setq dwglst '("1111111111.dwg" "222222222222.dwg"
"3333333333333.dwg" "444444444444444.dwg"
"55555555555555.dwg" "6666666666666666.dwg"
"7777777777.dwg" "888888888888.dwg"
"9999999999.dwg"
)
  )
  (dcl-project-import XD-ODCL-DATA-PURGEALL "123456")
  (dcl-Form-Show XD-P-FORM)
  (princ)
)

XDCAD

Text problem has been solved,used (dcl-control-redraw ......),

However, the progress bar and text are not synchronized problem exists, see figure。

When the number of 6, the progress bar has not yet started, how to synchronize?


(defun c:tt (/)
  (setq XD-ODCL-DATA-PURGEALL '
("YWt6A/MdAAD6fnL+BuKTJzMRJTtqQ1ET4qmq3tTWFPomOhQ0Xa8+kqa6/zMqNHvKX98arxuD78rb" "ECzrfi9Jzh1/dSi+/OG+2brpJgh7xVInzh4nd3QSduv++AXRY8HnbZlDRQga9g6L4kcNGbiJs6IN"
"GbCKrrjD8yp4JzJe+UJg+R4D8FDd/EzUZr0Lor7M6mmOzIJV31YGMq7U6tD3y1SbQH4Vfb7egquQ" "XWuVQPdXahqe8grm7JhnB7h6KXqb2iruYVI2J5VY2wg8IlYdIpSMLE1bC5iw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8U1YKs2ope3YcRNVM803rKog4fEYZeqiEGwQKcSg3C4L"
"1h8lBsLqQ9clJwUJcvFf5P5mt8XxPNYtd4JIw7kF+kXrtqU2nBLsemCiVP/NgD9BFjl6CTGaJxyC" "yWGKRwQJn3bNyO39AXncqvB6TznmPZaT+L9chlyAVVwGyVH2Rmalxk4koSVpOBgJDLeFFuw1pMNO"
"lLx7r06kbaP7fiXHaQ0/GoPFA+aU93ag5xyD4S9jT1QAidMjU1ojdJLqS2P2kGGfzbrQKx0mvFym" "0C+I/naYFpMPSrv2ECXfo2ijE/YStc3wtkgBY+8j/1HME4Jm7xMH5DsIMjowvfE2pdEIL3qVgdEI"
"XPyLjXHR8Qiv"
)
  )
  (defun c:XD-P-FORM#OnInitialize (/)
    (dcl-Control-SetMaxValue XD-P-1 (length dwglst))
    (dcl-Control-SetMinValue XD-P-1 0)
    (dcl-Control-SetValue XD-P-1 0)
    (dcl-Control-Redraw XD-P-1)
  )

  (defun c:XD-P-OK#OnClicked (/)
    (setq i 1)
    (dcl-Control-SetMaxValue XD-P-1 (length dwglst))
    (dcl-Control-SetMinValue XD-P-1 0)
    (dcl-Control-SetValue XD-P-1 0)
    (dcl-Control-Redraw XD-P-1)
    (foreach n dwglst
      (dcl-Control-SetCaption XD-P-TEXT n)
      (dcl-Control-Redraw XD-P-TEXT)
      (dcl-Control-SetValue XD-P-1 i)
      (dcl-Control-Redraw XD-P-1)
      (dcl-Control-SetCaption XD-P-4 (itoa i))
      (dcl-Control-Redraw XD-P-4)
      (setq n 500000)
      (while (> n 0)
(setq n (1- n))
      )
      (setq i (1+ i))
    )
    (princ)
  )
  (setq dwglst '("1111111111.dwg" "222222222222.dwg"
"3333333333333.dwg" "444444444444444.dwg"
"55555555555555.dwg" "6666666666666666.dwg"
"7777777777.dwg" "888888888888.dwg"
"9999999999.dwg"
)
  )
  (dcl-project-import XD-ODCL-DATA-PURGEALL "123456")
  (dcl-Form-Show XD-P-FORM)
  (princ)
)

XDCAD

The issue of synchronization is solved and is a matter of percentage
However, the first two codes when I design the dialog box did not choose the percentage, the election is NONE,
in this case VALUE value also give a percentage? Not by the number of increments?

(defun c:tt (/)
  (setq XD-ODCL-DATA-PURGEALL '
("YWt6Aw8hAADVhgHlBuKTJMERIjtugOBt4WGwf+8vanUvJvQ9Um/9kQJp4Tcd+25/9893UCyYAKY3" "trvw/H9VcwpqLi5/ewF8QVsA90wrliIsLi5cP3ZzWGxuTU2xx8mFuwCxGaGb9rsnkRDB46MDzcWN"
"s5DywgmLiBRY+UI4Lz5vOV4m4YN11t/0RPgPZynOXpsnwlQBa+p7cXUk7Kxb76jbonsex3mW6yGT" "QCbNkB1mOTd4sDf5Dxfg7RkmDjMuPzRbBx83tCRJWMvd3DxrXSwp6uQP100LKAu69N5PF+/pQCsv"
"HSY41Tel9IuohEdlDzCEa9tKXAsbFdcxMyRpO0j1csz/VFdh3mEfHrQdM4+QbUypVUzRYryVlsVd" "JxVs4LgQRuGOM3oJtEG1/p85TAKKdyqNjmG80W2Q9YWhrI8AWodlYJDRnBfivw/no8pCWU77rea6"
"f4fjuY2MIr7cQhun7HXGVA1zwfe5SQPBXIJLn1F3gTuEUm+wekCARSBhY1YCZUPzu6uLR86fHCE9" "ya1vHzZdAZGLAp6QK3b5HKOxNFfVk2FIhlqRDJjqUiw7aNZQOMygQAlfEtJ/kY+Q+NivYtkcxwh0"
"TaDVbgAwSI170y9RnwfRAQhsUR0+4I3YECO0uZuFYryRnImgLsNiJVSXRjHu4IUch8ycl2bB2Ybb" "ZolVgPuYD07oAdWMaR1C34Zap7BXvO36IV6SkQ5YoJ9cvD3KOLAgUVew7CMI7YsCOIwxdgE0hh28"
"EuOL+EBvwDaGLD3BHieJGP+a0W4A+aAJ3c9ob8BjycmHgTiDAROOUrz9qoEY0vEAZ0lgTOK68wKF" "aYhAIbZohPCZrnyhvwgEcQK3kY4DtxtKmTXywfBRB3WTilv7OiEMeBWiBq4ebEmowWESDJEzkJLD"
"hy2gBdhkLU+zSObkMjvYVC0N1ZlsLexXlS4EO6n7V7FQ/xPtE6LPq3+GyBSMA1oJEgtcJrkbzpPY" "x3IITxKVkkysIrI/rKmfuHEWR0ni5apy4Gt4slpMGjYRKMXa7ksG5mfMGbhc/TtivRWMw1Zpwocz"
"DluncQgznxpkYWCPkbikXcRpQR3Jn1RQ9BzLOqhmoFfSNx23hdrZvexfhlJX286aRES1bMXDRFJH" "8WjOev/BQEAVBAI1NRzy4PknS4BDeHFPHcytaCHh7ZFWvEAYbwhEGeKNOrtQ+RI7gNprwDtGdgKC"
"ebcpdtmjS4S2/KyCECmelcFB6Klqia3wQjQA44OKL6zR/WhHf6FckwIRyztAwKdFMVCr3Yl4L9m/" "JxdC/F0MjanqNDdE8fQrKKgsShvVqVq10qoV41glmFIfTVTTdOicr0ow4sivgA1IKC9aW2VZURP1"
"KKxK7qjrMyjOiZvbKsyqL7DsRgeVo5PYE2ClThPtMTWlpoqHFMg0sJNUnxitRKm2KmMUpm/g4phH" "0jknDYfJ2W5RPjxEFmnnrgitPZGsQkBewqOKr3iX3AIkBNaJkIouoMGWebN6v9N1jLJPgKlRhBLD"
"E8a8UhGbnMHz3qrQencp5sOWkv+/P44nolE/jsO1wjvtFFwfyszNbDhYCQK3+Sa56Qpep0L+mPwQ" "dVnmBXd3XJWhlLUqOfye0zvSgU0UJfI0QAPdqjwkLB7V0hdclshtvh+3MY4nHBereugObhIX6mNu"
"es3LCKbkbPwQpd8IeaMzeqeYGeV2zBOC+l6lgoovHDj8OzC+yTZF0aRmepWBYBJZdqixwU+qspE="
)
  )
  (defun c:XD-P-FORM#OnInitialize (/)
    (dcl-Control-SetMaxValue XD-P-1 (length dwglst))
    (dcl-Control-SetMinValue XD-P-1 0)
    (dcl-Control-SetValue XD-P-1 0)
    (dcl-Control-Redraw XD-P-1)
  )

  (defun c:XD-P-OK#OnClicked (/)
    (setq i 1)
    (dcl-Control-SetMaxValue XD-P-1 100)
    (dcl-Control-SetMinValue XD-P-1 0)
    (dcl-Control-SetValue XD-P-1 0)
    (dcl-Control-Redraw XD-P-1)
    (foreach n dwglst
      (dcl-Control-SetCaption XD-P-TEXT n)
      (dcl-Control-Redraw XD-P-TEXT)
      (setq pos (fix (+ 0.5 (* 100 (/ i (length dwglst) 1.0)))))
      (dcl-Control-SetValue XD-P-1 pos)
      (dcl-Control-Redraw XD-P-1)
      (dcl-Control-SetCaption XD-P-4 (itoa i))
      (dcl-Control-Redraw XD-P-4)
      (dcl-Control-SetCaption XD-P-5 (strcat (itoa pos) "%"))
      (dcl-Control-Redraw XD-P-5)
      (setq n 2500000)
      (while (> n 0)
(setq n (1- n))
      )
      (setq i (1+ i))
    )
    (princ)
  )
  (setq dwglst '("1111111111.dwg" "222222222222.dwg"
"3333333333333.dwg" "444444444444444.dwg"
"55555555555555.dwg" "6666666666666666.dwg"
"7777777777.dwg" "888888888888.dwg"
"9999999999.dwg"
)
  )
  (dcl-project-import XD-ODCL-DATA-PURGEALL "123456")
  (dcl-Form-Show XD-P-FORM)
  (princ)
)


owenwengerd

Try changing the 'Max. value' property of the progress bar to 200 for example, then I think the difference will be more clear.
Owen Wengerd (Outside The Box) / ManuSoft