181 Commits
Author SHA1 Message Date
aksdb 99749a5168 ✅ Add FPCUnit test suites for shared code and server
Introduces two headless FPCUnit runners under tests/ with 119 tests
covering the shared stream, cache, and packet layers, the MUL file
library, and the server config, region, account, and landscape
bounds logic. Each runner uses its own object output directory so
client and server PPUs with colliding unit names cannot pollute
each other's builds. Drone now builds and runs both suites before
packaging. Found on the way: two product defects fixed in the
previous commits.
2026-11-15 22:08:32 +01:00
aksdb ca8a0afc3b 🚨 Rename a local that shadowed the localization text property
The unit did not compile standalone because the serialize routine
declared a variable with the name of the published property.
2026-11-15 22:08:32 +01:00
aksdb 2b6f684505 🐛 Write full row byte counts when encoding land art
The land encoder passed word counts as byte counts to the stream
write, so every diamond row was truncated to half its length and
saved land tiles were unreadable.
2026-11-15 22:08:32 +01:00
aksdb 8f70a5cc98 🐛 Release large scale operation state on failure
The bitmask arrays, operations, and pending radar packets were only
released at the end of the straight-line handler, so any exception
leaked tens of megabytes per malformed request.
2026-11-15 22:08:32 +01:00
aksdb e38a487d56 🐛 Free the block parts when loading corrupt map data fails
A failed block creation leaked the already constructed halves and
the index.
2026-11-15 22:08:32 +01:00
aksdb 208ad57777 🐛 Validate radar map file data
Odd-sized radar color files, short static blocks, and tile IDs
beyond the color table read or wrote past their arrays at startup.
2026-11-15 22:08:32 +01:00
aksdb 6df8df9a9b 🐛 Validate tile IDs in static insertion
Sub-4000 filter entries underflowed to huge tile IDs, and placing
on top of statics with corrupt IDs indexed past the tiledata array.
2026-11-15 22:08:32 +01:00
aksdb 8731ec150c 🐛 Accept empty tile filters in large scale operations
An empty tile list is a valid no-filter request, but the
constructors dereferenced the empty array while reading it.
2026-11-15 22:08:32 +01:00
aksdb 45386dcbaf 🐛 Free the config document on validation failures
Invalid or outdated configuration leaked the parsed XML document
while aborting startup.
2026-11-15 22:08:32 +01:00
aksdb 5910178309 🐛 Free compression buffers when server-side compression fails 2026-11-15 22:08:32 +01:00
aksdb 0d1c61364b 🐛 Skip unauthenticated sockets in region update notifications
Region change notifications dereferenced the account of every
socket, crashing on connections that had not logged in.
2026-11-15 22:08:32 +01:00
aksdb b3a3b090b4 🔒 Handle missing accounts in user modification responses
Rejecting an empty username built the response packet from a nil
account reference.
2026-11-15 22:08:32 +01:00
aksdb 464c170e2d 🔒 Skip unauthenticated sockets in admin broadcasts
Any connection that had not finished logging in has no account, and
dereferencing it aborted the broadcast for all remaining admins.
2026-11-15 22:08:32 +01:00
aksdb 46aaec645c 🐛 Stop block requests with no coordinates from crashing
A truncated request packet produced an empty coordinate array whose
first element was dereferenced.
2026-11-15 22:08:32 +01:00
aksdb e12fe942b7 🔒 Validate compressed packets on the server
A client could declare an unbounded decompressed size to exhaust
server memory, nest compressed packets recursively, or send a
truncated inner packet whose handler read garbage.
2026-11-15 22:08:32 +01:00
aksdb 7acd461086 🐛 Stop broadcasting to unauthenticated sockets
Change and radar packets reached every connected socket, leaking
map edit activity to anyone who had opened a connection without
logging in. The state sweep also ran per loop tick; it now runs
once per second.
2026-11-15 22:08:32 +01:00
aksdb 4a7f525937 🚨 Keep the server receive queue consistent on errors
A handler exception left the stream locked and skipped the packet
dequeue, permanently desyncing the connection. Declared packet
sizes are now validated against a sane range, and clients sending
garbage are dropped instead of stalling the queue.
2026-11-15 22:08:32 +01:00
aksdb e74065fd49 🚨 Reject out-of-range block subscriptions
The off-by-one bounds check let a crafted free-block packet index
one past the subscription array and follow garbage memory as a
client list, corrupting the heap.
2026-11-15 22:08:32 +01:00
aksdb 0a939d4f35 🚨 Free login profile handles on read or write errors 2026-11-15 22:08:32 +01:00
aksdb ef124eb495 🚨 Default to no access when no access level is selected 2026-11-15 22:08:32 +01:00
aksdb b7235f8f93 🚨 Stop account saves with exactly 256 regions from losing them
The region count was clamped to 256 and wrapped to zero in the
byte field, truncating the account's region list server-side.
2026-11-15 22:08:32 +01:00
aksdb 74cf40118c 🚨 Truncate tile lists to the wire limit consistently
Serializing more than 65535 tiles wrote a wrapped count while
sending every tile, desynchronizing the server-side parse.
2026-11-15 22:08:32 +01:00
aksdb bd60c99dc3 🚨 Clean up large scale command form teardown
Executing with no areas leaked the built packet, and pending tile
selection listeners stayed registered after the form was destroyed.
2026-11-15 22:08:32 +01:00
aksdb 335cfc875c 🚨 Mark mouse-created areas as unsaved changes
Drawing a new area rectangle on the map did not arm the save
button, so the area was silently discarded on the next switch.
2026-11-15 22:08:32 +01:00
aksdb f8f56d6b2f 🚨 Unregister the region dialog from access change notices
FormDestroy never removed its listener, leaving a dangling method
pointer in the main form's listener list after teardown.
2026-11-15 22:08:32 +01:00
aksdb aaaad354b2 🚨 Drop the temp region node before refreshing the list
The region list refresh freed all tree nodes, leaving the pending
new-region pointer dangling while its save button stayed armed.
2026-11-15 22:08:32 +01:00
aksdb 4f6e034b5c 🚨 Save edits to the region being edited
When switching regions with unsaved changes, the save prompt ran
after the tree had already moved its selection, so the old region's
areas were written into the newly selected region on the server.
The save now targets the region whose areas are loaded in the
editor.
2026-11-15 22:08:32 +01:00
aksdb 9864157f33 🚨 Stop region saves with exactly 256 areas from wiping them
The count was clamped to 256 and then stored in a byte, wrapping to
zero, so the server replaced the region with an empty area list.
2026-11-15 22:08:32 +01:00
aksdb 818590ded0 ⚡ Cache tile list thumbnails in memory
The tile browser decoded art from disk and rebuilt the image on
every repaint of every visible cell; entries are now decoded once
and reused.
2026-11-15 22:08:32 +01:00
aksdb 75220f3dc4 ⚡ Set the light mode once per run of tiles
The render loop reissued the light state calls for every tile even
when the mode was unchanged.
2026-11-15 22:08:32 +01:00
aksdb fbfd8e627f 🚨 Clamp UOA design placement altitude in both directions
Moving a design only guarded the upper altitude bound, letting tile
altitudes wrap past the signed range.
2026-11-15 22:08:32 +01:00
aksdb 0092f6893e 🚨 Return an empty rectangle when no tile is selected
GetSelectedRect left its result undefined when called without a
current tile.
2026-11-15 22:08:32 +01:00
aksdb b47292a4bc 🚨 Guard location name serialization against empty strings
Saving or loading an unnamed location indexed the first character
of an empty string.
2026-11-15 22:08:32 +01:00
aksdb 4d9e02aaef 🚨 Ignore disconnect notices for unknown clients
Deleting at index -1 raised an exception and aborted the packet
dispatch when the list had already diverged.
2026-11-15 22:08:32 +01:00
aksdb 5f7e277721 🚨 Free detached DOM nodes when deleting random presets
RemoveChild detaches without owning the node; every deleted preset
or overwritten preset entry leaked it.
2026-11-15 22:08:32 +01:00
aksdb 481d6ac905 🚨 Free the edit target list when an edit action fails mid-way 2026-11-15 22:08:32 +01:00
aksdb dd20f4962d 🚨 Nil the label pointer when freeing a screen block label
Freeing without clearing left a dangling reference that a repeated
prepare pass would free again.
2026-11-15 22:08:32 +01:00
aksdb 1fbce3570d 🚨 Release the old material when re-highlighting a static
Hovering with hue highlighting reassigned the screen buffer material
without dropping the previous reference, leaking a GL texture on
every hover.
2026-11-15 22:08:32 +01:00
aksdb f09b8b7fbc 🚨 Validate radar map packet payloads
An empty radar map indexed an empty array, and update coordinates
from the server were written into the image without bounds checks.
2026-11-15 22:08:32 +01:00
aksdb fcb90dffbb 🚨 Handle empty or unreadable radar cache files
A zero-byte cache file indexed an empty array, and read errors
leaked the file stream.
2026-11-15 22:08:32 +01:00
aksdb 71865facd8 🚨 Make radar shutdown safe
Destroying the radar window dereferenced the image without a nil
check when creation had failed, and leaked the cache file stream on
write errors, skipping cleanup of the remaining objects.
2026-11-15 22:08:32 +01:00
aksdb 93c2af9d9f 🚨 Free the light config document and tolerate a missing file
LoadConfig leaked the parsed XML document on every call and aborted
startup when the color config file was absent.
2026-11-15 22:08:32 +01:00
aksdb 043a5a1ccf 🚨 Free the light collection when the light map update fails 2026-11-15 22:08:32 +01:00
aksdb 3dd9ce1d68 🚨 Mark the light manager as initialized
The flag was never set, so the framebuffer extension was reloaded on
every frame with lights enabled.
2026-11-15 22:08:32 +01:00
aksdb b90fbdf190 🚨 Clamp drawn tile altitudes to the valid range
Drawn statics could exceed the signed altitude range and wrap
around.
2026-11-15 22:08:32 +01:00
aksdb 1e44b51a06 🚨 Apply random elevation offsets in raise and lower modes
The random offset was computed first and then overwritten by the
raise and lower branches.
2026-11-15 22:08:32 +01:00
aksdb 78f945cee7 🚨 Expose the draw action hue
The draw action reads its hue field but no property ever exposed
it, so hue selection was silently ignored.
2026-11-15 22:08:32 +01:00
aksdb 3e562ff03d 🚨 Take the elevation target as a signed byte
The coordinate-based elevate overload accepted a word and silently
truncated it when writing the signed altitude byte.
2026-11-15 22:08:32 +01:00
aksdb 992666583d 🚨 Guard block requests without coordinates 2026-11-15 22:08:32 +01:00
aksdb 63ca31805e 🚨 Free compression buffers when packet compression fails
A compression error leaked the buffers and the wrapped packet,
whose ownership had already been transferred.
2026-11-15 22:08:32 +01:00
aksdb c4c95b0156 🚨 Validate decompressed packets before dispatch
A compressed packet could declare an unbounded decompressed size,
nest compressed packets recursively until stack overflow, or carry a
truncated inner packet whose handler then read uninitialized
memory.
2026-11-15 22:08:32 +01:00
aksdb d18e01c95c 🔒 Validate login response fields
The access level byte and landscape dimensions were trusted from
the network without checks.
2026-11-15 22:08:32 +01:00
aksdb c4f043a236 🚨 Isolate packet handler exceptions on the client
A handler exception left the packet in the queue, re-raising on
every receive until the app aborted. The connection is now dropped
cleanly with a log entry.
2026-11-15 22:06:51 +01:00
aksdb ad38619b9b 🚨 Validate packet lengths from the server
A declared length below the header size desynced the receive queue
and dispatched handlers on garbage, and an unbounded length could
grow the queue without limit.
2026-11-15 22:06:51 +01:00
aksdb 0222c01dc8 🚨 Stop double-freeing the connection packet handler at exit
Unit finalization already frees the handler table; freeing the
shared handler again from the datamodule corrupted the heap on
shutdown.
2026-11-15 22:06:51 +01:00
aksdb 997aa4991a 🚨 Stop the range selection helper from leaking
Abandoning a selection after the first click leaked the helper and
kept it registered for tile clicks. The helper now tracks the active
instance, copies coordinates instead of holding tile references that
can be evicted, and the listener dispatch tolerates removal during
iteration.
2026-11-15 22:06:51 +01:00
aksdb a1a40b6f61 🚨 Use the pointer-sized window call on 64-bit Windows
SetWindowLong truncates 64-bit window handles, breaking dialog
parenting on Win64 builds.
2026-11-15 22:06:51 +01:00
aksdb ee0667aff3 🚨 Skip empty font info tables
A truncated font resource indexed an empty array on load.
2026-11-15 22:06:51 +01:00
aksdb c6e1a10d3b 🚨 Check the arrow texture height, not the width twice 2026-11-15 22:06:51 +01:00
aksdb 7c3c4d89c4 🚨 Close the UOA design data file on shutdown
The design collection never freed its data stream, leaking the file
handle for every use.
2026-11-15 22:06:51 +01:00
aksdb d56149a4c1 🚨 Clamp imported UOA design values to their field ranges
Out-of-range tile, position, and hue values from a design file
truncated or raised range errors on import.
2026-11-15 22:06:51 +01:00
aksdb 9903de9c24 🚨 Guard animation texture deletion against empty frame lists
Destroying an animation material with no frames dereferenced an
empty array.
2026-11-15 22:06:51 +01:00
aksdb 6d0ae63be6 🚨 Clamp write permission areas to the landscape size
The write map trusted area coordinates from the login response and
could index a bits array far out of bounds with hostile data.
2026-11-15 22:06:51 +01:00
aksdb fa288fddf8 🚨 Harden the nodraw map loader
A parse error leaked the file handle and negative IDs from a
malformed file indexed the draw bitmap out of bounds.
2026-11-15 22:06:51 +01:00
aksdb 1335e3f40e 🚨 Validate tile and hue IDs from network data
Static materials indexed the tiledata array and hue table with
unchecked IDs from the server, crashing the client on malformed
packets.
2026-11-15 22:06:51 +01:00
aksdb 1dc371ed27 🚨 Free the block index when a landscape update fails mid-packet 2026-11-15 22:06:51 +01:00
aksdb 3df6ab93f6 🐛 Free the client statics decode buffer on malformed data 2026-11-15 22:06:51 +01:00
aksdb d9f7b126b6 🐛 Load client static blocks stored at offset zero
The client used the same offset-zero bug as the server loader,
dropping the first static block of a freshly written file.
2026-11-15 22:06:51 +01:00
aksdb 2cc0be66c9 🐛 Keep the screen buffer tail pointer valid on inserts
Inserting an item that sorted after everything left the tail
shortcut stale, so later appends unlinked existing nodes. This
leaked screen entries, their textures, and blocked cache eviction
forever.
2026-11-15 22:06:51 +01:00
aksdb b4a14683cb 🐛 Add half of the dominant slope to effective altitude
The altitude helper halved the smaller delta instead of the dominant
one, miscalculating draw priorities on every diagonal slope.
2026-11-15 22:06:51 +01:00
aksdb 3fed4cd5fc 🐛 Use the correct height for landscape draw range
The row loop iterated by width, dropping terrain rows whenever the
draw range was clipped asymmetrically at the map borders.
2026-11-15 22:06:51 +01:00
aksdb f4275217bb ⚡ Encode multimaps from scanlines instead of canvas pixels
Reading the canvas per pixel made writing a multimap orders of
magnitude slower than necessary.
2026-11-15 22:06:51 +01:00
aksdb d5c41c0816 🐛 Stop multimap decode from spinning on truncated data
A failed or zero-length run read left the decoder looping forever
without consuming input.
2026-11-15 22:06:51 +01:00
aksdb d3045de064 🐛 Validate animation data lookups against the entry count
Out-of-range IDs indexed the entry array unchecked and corrupted
memory instead of failing.
2026-11-15 22:06:51 +01:00
aksdb 32b8d99f3e 🐛 Report the encoded size of localization entries
GetSize counted characters while serialization writes UTF-8 bytes,
desynchronizing any offset arithmetic for non-ASCII text.
2026-11-15 22:06:51 +01:00
aksdb 81f837a746 🐛 Reject out-of-range hue lookups
The modulo silently wrapped invalid IDs to a wrong hue group instead
of failing.
2026-11-15 22:06:51 +01:00
aksdb d41520eca4 🐛 Free the hue decode buffer on malformed data 2026-11-15 22:06:51 +01:00
aksdb 13aae33a02 🐛 Skip empty entries when loading flat land art
An art index entry with lookup zero and no size made the decoder
copy the whole remaining art file.
2026-11-15 22:06:51 +01:00
aksdb 0c94cdb24b 🐛 Skip gump entries with no data
An index entry with a valid lookup but zero size copied the entire
rest of the gump file into memory before decoding garbage.
2026-11-15 22:06:51 +01:00
aksdb d2fb8a16ea 🐛 Handle truncated gump data safely
A zero run length or a short read at the end of the data left the
row decoder spinning forever, and runs that overshot the row width
wrote past the image buffer. The decode buffer is now freed on
errors as well.
2026-11-15 22:06:51 +01:00
aksdb 2c0eb0cebd 🐛 Deduplicate block event registrations
Registering the same change handler twice fired destroy and change
notifications twice for one block.
2026-11-15 22:06:51 +01:00
aksdb 9ed3862b4a 🐛 Validate tiledata lookups against the entry count
Out-of-range tile IDs indexed past the arrays and read arbitrary
memory instead of failing.
2026-11-15 22:06:51 +01:00
aksdb 6229d296df 🐛 Use version-aware offsets when writing High Seas tiledata
The write path always computed legacy offsets and sizes while the
loader detected and used the High Seas layout, so any tile edit on a
High Seas tiledata.mul shifted records and corrupted the file.
2026-11-15 22:06:50 +01:00
aksdb ee8dfe5adf 🐛 Free the statics decode buffer on malformed data
The constructor leaked its temporary stream when decoding raised on
corrupt static data.
2026-11-15 22:06:50 +01:00
aksdb d129a1b94f 🐛 Load static blocks stored at file offset zero
The lookup check treated offset 0 as empty, silently discarding the
first static block of a freshly written statics file.
2026-11-15 22:06:50 +01:00
aksdb c0121312ed 🐛 Stop map block clones from leaking their cells
Clone overwrote the freshly created cell array without freeing it,
leaking 64 cells per clone, and dropped the block header.
2026-11-15 22:06:50 +01:00
aksdb dab5f85816 🐛 Run the inherited destructor for animation groups
TAnimDataGroup.Destroy skipped the inherited call, so the base class
never fired its destroy notifications and leaked the handler state.
2026-11-15 22:06:50 +01:00
aksdb c8ef2ccf68 🐛 Free the animation data provider on shutdown
The manager released every provider except the animation data
provider, leaking its file stream and the whole animation table.
2026-11-15 22:06:50 +01:00
aksdb 23f323bee1 🐛 Create the texture save buffer for streamed textures
Textures loaded from file never had their buffer allocated, so any
save attempt crashed with an access violation.
2026-11-15 22:06:50 +01:00
aksdb ae9136d53a 🐛 Free the art decode buffer on malformed data
The constructor leaked its temporary stream whenever a decode
operation raised, for example on truncated or corrupt art data.
2026-11-15 22:06:50 +01:00
aksdb c1967a8a41 🐛 Fix art encoder writing corrupted images
The static RLE encoder read 16-bit pixels from the 32-bit working
image with a 16-bit stride, garbling every pixel and testing a green
channel bit as the visibility flag. The land encoder shifted every
diamond row to a constant or double-stride column. Both matched the
decoder on load and produced scrambled art on save. Also frees the
conversion image on the early exit paths.
2026-11-15 22:06:50 +01:00
aksdb c1f5215fb4 🐛 Stop linked list delete from storing a disposed node
Delete continued the loop with a dangling previous-node pointer after
disposing the matched entry. It now returns after the first match,
which is the behavior all callers rely on.
2026-11-15 22:06:50 +01:00
aksdb e527149f63 🐛 Check node type before treating XML children as text
Reading or updating a value whose first child was a comment or CDATA
node crashed with a failed class cast.
2026-11-15 22:06:50 +01:00
aksdb 39045b76c1 🐛 Fall back to default on invalid boolean config values
ReadBoolean raised an exception on malformed XML text instead of
using the supplied default.
2026-11-15 22:06:50 +01:00
aksdb 5e92d58a6e 🐛 Fix buffered stream flush losing data
Flush sized the base stream from its own overridden size, which
delegates to the base stream, so appended data was truncated or the
copy failed. Flushing a reader would have wiped the file; the reader
writes through immediately and needs no flush. Write now also
propagates short writes from the base stream.
2026-11-15 22:06:50 +01:00
aksdb 2bffd2204b 🐛 Guard fixed-length stream reads against short data
ReadStringFixed returned uninitialized memory on short reads and
crashed on negative lengths from untrusted input.
2026-11-15 22:06:50 +01:00
aksdb 1498437e26 🐛 Validate fifo stream bounds and locking
Seek accepted positions outside the queue, allowing reads before the
buffer, and negative counts reached Move with garbage sizes. Writing
to a locked stream silently dropped the lock window instead of
failing, which corrupts packet parsing.
2026-11-15 22:06:50 +01:00
aksdb a25c8296de ⚡ Pad fixed-length strings in one step
WriteStringFixed grew the string one character at a time, which is
quadratic in the target length.
2026-11-15 22:06:50 +01:00
aksdb 585fd92611 🐛 Fix out-of-bounds reads in stream string readers
The null and wide-string readers tested the terminator before the
bounds check, peeked one character past the window, and used a
lock-relative position against the absolute memory base. They also
advanced past a terminator that was never read, desyncing the parser
on malformed input. Reworked them to stay in bounds and to build the
result in linear time.
2026-11-15 22:06:50 +01:00
aksdb f381647149 🐛 Repair cache invariant after stores
StoreID left the last-entry pointer on the final node, so two
consecutive stores without an intervening query nil-dereferenced.
2026-11-15 22:06:50 +01:00
aksdb 4108ed5900 🐛 Fix cache last-entry corruption on hits
QueryID set the last-entry pointer to the moved node on every hit,
breaking the pointer-to-second-to-last invariant. StoreID then
orphaned tail entries, leaking cached objects and crashing on cache
destruction.
2026-11-15 22:06:50 +01:00
aksdb 98bfbd7b11 🐛 Reject cache manager sizes below 2
A size of 0 or 1 left the internal last-entry pointer nil, crashing on
the first store operation.
2026-11-15 22:01:27 +01:00
aksdb 3f47eba2da 🚨 Fix UfrmLogin not compiling 2024-11-03 16:32:35 +01:00
aksdb 4d92724f4e ✨ Support QT6 2024-11-03 16:32:09 +01:00
aksdb 23b4ebe214 🔨 Add project group 2024-11-03 16:31:41 +01:00
aksdb 3b6b8b6eb3 🚨 Fix cedserver paths 2024-11-03 16:31:17 +01:00
aksdb 27cf279503 🚨 Fix UfrmLargeScaleCommand not compiling 2024-11-03 16:31:04 +01:00
aksdb 955edf8a77 🐛 Fix moving of items freeing the item in the process
continuous-integration/drone/push Build is passing
2022-10-16 17:27:18 +02:00
aksdb 9638bb3fe2 👷 Add win64 build config 2022-10-16 17:26:55 +02:00
aksdb 7be5c8ca7f 👷 Update lazarus in builder
continuous-integration/drone Build is passing
2022-10-16 12:08:55 +02:00
aksdb e0eee2c023 👷 Upload snapshots
continuous-integration/drone/push Build is passing
2022-08-14 20:00:05 +02:00
aksdb 816017d4f1 👷 Add CI pipeline
continuous-integration/drone/push Build is passing
2022-08-13 11:50:48 +02:00
aksdb d30b95f857 🔀 Merge pull request 'Place UOA design' (#4) from uoa_designs into master
Reviewed-on: #4
2022-07-21 08:47:39 +02:00
aksdb 6aa6496429 ⚡️ Speed up preview rendering 2022-07-20 20:22:42 +02:00
aksdb 9f66004c44 🐛 Fix invalid Z range on load 2022-07-20 20:22:29 +02:00
aksdb b83c5f4b2d 🚸 Lock actions during placement 2022-07-20 19:29:55 +02:00
aksdb 54e7209c8d ✨ Finish placement as per preview 2022-07-20 19:23:31 +02:00
aksdb 1753c38eea 🚧 Preview design placement 2022-07-20 18:54:00 +02:00
aksdb cd983844fa 🔇 Remove debug log 2022-07-19 20:11:08 +02:00
aksdb 7a67e62398 ✨ Draw UOA designs 2022-07-19 20:09:24 +02:00
aksdb 0e5cb1b48b ✨ Load and list UOA designs 2022-07-19 18:24:03 +02:00
aksdb d75a85d269 🚧 Implement actions as objects 2022-05-29 11:46:22 +02:00
aksdb dc36f0b09c 💄 Fix more form layouts 2022-05-22 15:51:56 +02:00
aksdb 97c8270b38 🐛 Fix Undo handling 2022-05-22 11:27:27 +02:00
aksdb dfef4d3556 🔧 Increase caches to accommodate larger resolutions 2022-05-08 18:42:01 +02:00
aksdb d30f01ac64 ⬆️ Update Vampyre Imaging lib 2022-05-08 10:47:53 +02:00
aksdb 5e47564252 💄 Enable UI scaling 2022-05-07 11:59:04 +02:00
aksdb 900603dd00 📝 Update the README 2022-05-07 11:00:51 +02:00
aksdb da7bf2e3c5 🙈 Update ignore file 2022-05-07 10:51:52 +02:00
aksdb 1bfbc2e11e ⬆️ Update to Lazarus 2.2 and FreePascal 3.2.2 2022-05-07 10:51:52 +02:00
aksdb 39280f927b * Fixed drop down toolbar buttons to correct their state
* Added terrain grid (ported from CentrED+; Thanks to StaticZ!)
2015-05-17 12:39:57 +02:00
aksdb 1ddaee39d5 * Removed heContrns dependency (replaced by fgl ... again) 2015-05-13 19:09:41 +02:00
aksdb d334728b6c * Fixed memory corruption in frmMain (caused by heContrns)
* Added range selection to frmBoundaries
2015-05-13 19:02:33 +02:00
aksdb 609ff53253 * Added X/Y boundaries 2015-05-11 19:30:23 +02:00
aksdb ffd0cc1028 * Added advanced statics filter (thanks to StaticZ) 2015-05-10 19:48:52 +02:00
aksdb 699fb78d72 * Fixed build modes
* Fixed windows build (RT_RCDATA was missing)
2015-05-10 18:45:06 +02:00
aksdb 484bd5523f * Migrated resources from custom resource manager to windows/lazarus resources (requires windres now!)
* Bumped version to 0.7
2015-05-10 18:20:40 +02:00
aksdb f3f5d12c2f * Added colored lights (thanks to StaticZ :-)) 2015-05-10 11:42:05 +02:00
aksdb 937cfb6323 Added tag 0.6.3 for changeset 3bf040abc031 2015-05-01 11:43:36 +02:00
aksdb e29f69a1a9 Added tag 0.6.2 for changeset 6bda4a5123d7 2015-05-01 11:43:23 +02:00
aksdb 91f3aadb82 * Updated to Lazarus 1.5 2015-05-01 11:42:50 +02:00
aksdb 2e3dd53eeb * Also add Build modes for cedserver
* Fixed widget sets in new debug build modes
2014-03-09 16:55:28 +01:00
aksdb 8085639c30 * Added debug build modes 2014-03-09 16:49:54 +01:00
aksdb 7271fcbabc * Removed obsolete file 2013-11-28 17:27:11 +01:00
aksdb 8f5c141705 * More build mode cleanup
* Directory cleanup and restructuring
2013-11-27 20:58:01 +01:00
aksdb d0557ab86f * More UMapManagement 2013-11-27 20:15:33 +01:00
aksdb b9a45bf43b * Enhanced UXmlHelper (enumerator)
* Added UMapManagement
* Fixed TCPServer to allow address reuse
2013-11-23 20:41:20 +01:00
aksdb 1791fd7494 * Clean up build modes 2013-11-27 18:25:00 +01:00
aksdb 829a604c30 * Added password change support (references #95)
* Fixed 64bit support
* Repaired line endings
* Bumped protocol version
2013-11-20 18:12:52 +01:00
aksdb 9676549ac3 * Updated Vampyre Imaging Lib
* Fixed heContrs compilation
* Fixed region editing in frmLargeScaleCommand and frmRegionControl
* Fixed control alignment in frmMain
2013-11-03 14:12:48 +01:00
aksdb 4a5a835afd * Bumped version
* Updated changelog
* Updated installer
2012-01-14 18:21:40 +01:00
aksdb 5ac13430be * Fixed possible range overflow 2012-01-14 18:09:07 +01:00
aksdb 940e81f123 * Replaced fgl with heContnrs
* Fixed behavior of the undo packet list (fixes #88)
2012-01-14 17:58:59 +01:00
aksdb aa37b1cf1d * Bumped version
* Updated copyright
* Read copyright from resource
* Removed obsolete lines from version.inc
2012-01-07 17:23:07 +01:00
aksdb 811d91cc8a * Refactored tiledata cloning
* Added support for new tiledata format (from the High Seas expansion)
2012-01-07 13:48:59 +01:00
aksdb 88e18b7659 * Fixed compilation with current Lazarus/LCL 2011-12-03 18:48:15 +01:00
aksdb 395c8fbe96 * Fixed TfrmHueSettings not freeing the preset doc 2011-10-03 20:32:46 +02:00
aksdb d2f7bdc54f - Fixed align of the Random checkbox on frmHueSettings 2011-04-01 18:02:38 +02:00
aksdb 5c3a8740c1 - Fixed more range violations (fixes #82) 2011-03-31 22:39:00 +02:00
aksdb abe62e13b8 - Changed the hue change mechanic (store the info in the ScreenBuffer instead of a separate list) (refs #66) 2011-03-30 20:52:24 +02:00
aksdb 4c76aafe47 - Fixed loading of hue presets
- Fixed random pane sliding out of the main window
2011-03-29 22:57:11 +02:00
aksdb 086e6dbb7b - Fixed some range violations 2011-03-29 22:04:39 +02:00
aksdb bfe71ae93f - Store used (random) hues for consistent behavior on commit (refs #66) 2011-03-29 21:51:17 +02:00
aksdb 4b5cf332ca - Changed versions to be read from the resource stream 2011-03-26 22:13:57 +01:00
aksdb de33600726 - Added hints to the "Restriction" column in the account list
- Reset the sorting when the list content changes
2011-03-26 12:29:31 +01:00
aksdb 977e53085a - Added more info to the account list (fixes #78) 2011-03-24 22:19:11 +01:00
aksdb be11f61111 - Implemented account list sorting (fixes #79) 2011-03-24 21:57:23 +01:00
aksdb b1be3a22de - Cleanup project file 2011-03-24 21:56:58 +01:00
aksdb 8bebb92300 - Added saving and loading of hue presets (refs #66) 2011-03-16 19:42:55 +01:00
aksdb 2a9598452b - Added reading and writing of RandomHuePresets (refs #66) 2011-03-12 23:46:57 +01:00
aksdb fd4155a45b - Added Drag&Drop for random hue list (refs #66) 2011-03-12 22:58:54 +01:00
aksdb ae720d1931 - Added manifest for Windows build 2011-03-12 22:13:26 +01:00
aksdb 87e4edffa5 - Fixed display of the current hue in the Draw settings dialog 2011-03-12 17:56:53 +01:00
aksdb 34e723db75 - Use the new GetHue method to draw hues (refs #66) 2011-03-12 17:49:08 +01:00
aksdb 6317841c9c - Added UI for random Hue (refs #66) 2011-03-12 17:11:46 +01:00
aksdb a309caa235 - Updated Project Files
- Fixed frmLargeScaleCommand for recent LCL changes
2011-02-04 23:37:06 +01:00
aksdb d158c28452 - Added build modes
- Fixed Login Form layout
- Fixed compilation with FPC 2.5.1
2010-12-25 14:43:17 +01:00
aksdb 49599fdcf4 - Added hgeol
- Fixed repository side eol to be LF
2010-07-25 00:18:54 +02:00
aksdb 0d84ac4b5d - Fixed compilation with recent Lazarus versions 2010-06-11 13:36:45 +02:00
aksdb 6edee941ee - Fixed filter window to invalidate the current filters on delete/clear 2009-12-28 16:40:37 +01:00
aksdb 5f76073b39 Added tag 0.6.1 for changeset c8f14a3d46ee 2009-12-24 19:16:16 +01:00
331 changed files with 78290 additions and 158497 deletions
+75
View File
@@ -0,0 +1,75 @@
---
kind: pipeline
type: docker
name: default
steps:
- name: Build
image: git.aksdb.de/aksdb/centred:builder-221016
commands:
- ~/lazarus/lazbuild --lazarusdir=~/lazarus --build-mode="Release.win32" -B Client/CentrED.lpr
- ~/lazarus/lazbuild --lazarusdir=~/lazarus --build-mode="Release.Linux.x64" -B Client/CentrED.lpr
- ~/lazarus/lazbuild --lazarusdir=~/lazarus --build-mode="Release.win32" -B Server/cedserver.lpi
- ~/lazarus/lazbuild --lazarusdir=~/lazarus --build-mode="Release.Linux.x64" -B Server/cedserver.lpi
- name: Test
image: git.aksdb.de/aksdb/centred:builder-221016
commands:
- ~/lazarus/lazbuild --lazarusdir=~/lazarus -B tests/unittests.lpi
- tests/bin/unittests --all --format=plain
- ~/lazarus/lazbuild --lazarusdir=~/lazarus -B tests/unittests-server.lpi
- tests/bin/unittests-server --all --format=plain
- name: Package
image: git.aksdb.de/aksdb/centred:builder-221016
commands:
- mkdir -p dist/client.win32 dist/client.linux.x64 dist/server.win32 dist/server.linux.x64
- cp Client.bin/nodraw.txt Client.bin/ColorLight.xml dist/client.linux.x64/
- cp Client.bin/nodraw.txt Client.bin/ColorLight.xml dist/client.win32/
- cp Client.bin/CentrED.x64 dist/client.linux.x64/CentrED
- cp Client.bin/CentrED.exe dist/client.win32/CentrED.exe
- cp Server.bin/cedserver.x64 dist/server.linux.x64/cedserver
- cp Server.bin/cedserver.exe dist/server.win32/cedserver.exe
- cd dist/client.win32 && zip ../CentrED.win32.zip *
- cd ../client.linux.x64 && tar czf ../CentrED.linux.x64.tgz *
- cd ../server.win32 && zip ../Server.win32.zip *
- cd ../server.linux.x64 && tar czf ../Server.linux.x64.tgz *
- name: Upload Client (win32)
image: vividboarder/drone-webdav
settings:
file: dist/CentrED.win32.zip
destination: https://aksdb.de/snapshots/CentrED/
username: centred
password:
from_secret: snapshots_password
- name: Upload Client (linux x64)
image: vividboarder/drone-webdav
settings:
file: dist/CentrED.linux.x64.tgz
destination: https://aksdb.de/snapshots/CentrED/
username: centred
password:
from_secret: snapshots_password
- name: Upload Server (win32)
image: vividboarder/drone-webdav
settings:
file: dist/Server.win32.zip
destination: https://aksdb.de/snapshots/CentrED/
username: centred
password:
from_secret: snapshots_password
- name: Upload Server (linux x64)
image: vividboarder/drone-webdav
settings:
file: dist/Server.linux.x64.tgz
destination: https://aksdb.de/snapshots/CentrED/
username: centred
password:
from_secret: snapshots_password
trigger:
branch:
- master
+2 -1
View File
@@ -1,6 +1,5 @@
obj/*
bin/*
dist/*
Client.bin/*
Server.bin/*
doc/*
@@ -24,3 +23,5 @@ Setup/*
*.sh
*.exe
*.res
tests/bin/*
tests/obj-tests/*
View File
+32
View File
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectGroup FileVersion="2">
<Targets>
<Target FileName="Tools/convertfontmap/ConvertFontMap.lpi"/>
<Target FileName="Client/CentrED.lpi">
<BuildModes>
<Mode Name="default" Compile="True"/>
<Mode Name="Release.Win32"/>
<Mode Name="Release.Win64"/>
<Mode Name="Release.Linux.x86"/>
<Mode Name="Release.Linux.x64"/>
<Mode Name="Debug.Win32"/>
<Mode Name="Debug.Linux.x86"/>
<Mode Name="Debug.Linux.x64"/>
</BuildModes>
</Target>
<Target FileName="Server/cedserver.lpi">
<BuildModes>
<Mode Name="default" Compile="True"/>
<Mode Name="Release.Win32"/>
<Mode Name="Release.Win64"/>
<Mode Name="Release.Linux.x86"/>
<Mode Name="Release.Linux.x64"/>
<Mode Name="Debug.Win32"/>
<Mode Name="Debug.Linux.x86"/>
<Mode Name="Debug.Linux.x64"/>
</BuildModes>
</Target>
</Targets>
</ProjectGroup>
</CONFIG>
+13
View File
@@ -0,0 +1,13 @@
# This file contains a list of all tiles to be ignored when the "NoDraw"
# option is not active.
# Lines starting with T are terrain tiles, S indicated static tiles.
# A - between numbers indicates a range of tiles.
#Terrain
T$2
#Statics
S$1
S$2198-$21A4
S$21BC
S$5690
+5
View File
@@ -0,0 +1,5 @@
LEFTTOPARROW RCDATA "Overlay/LeftTopArrow.tga"
TOPARROW RCDATA "Overlay/TopArrow.tga"
VIRTUALLAYER RCDATA "Overlay/VirtualLayer.tga"
DEJAVU RCDATA "GLFont/DejaVu.png"
DEJAVUDAT RCDATA "GLFont/DejaVu.fnt"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

+249 -177
View File
@@ -1,15 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="9"/>
<Version Value="12"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CentrED+"/>
<Title Value="CentrED"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<DpiAware Value="True"/>
</XPManifest>
@@ -20,23 +22,24 @@
<UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/>
<MinorVersionNr Value="7"/>
<RevisionNr Value="8"/>
<BuildNr Value="1760"/>
<Language Value="0419"/>
<StringTable CompanyName="www.uoquint.ru" FileDescription="UO CentrED+" InternalName="CentrED+" LegalCopyright="StaticZ" OriginalFilename="CentrED-plus.exe" ProductName="CentrED+" ProductVersion="0.7.8"/>
<BuildNr Value="264"/>
<StringTable CompanyName="AKS DataBasis" FileDescription="UO CentrED" InternalName="CentrED" LegalCopyright="(c) 2022 Andreas Schneider and StaticZ" OriginalFilename="CentrED.exe" ProductName="CentrED" ProductVersion="0.7.0"/>
</VersionInfo>
<BuildModes Count="5">
<BuildModes Count="8">
<Item1 Name="default" Default="True"/>
<Item2 Name="Release Win32">
<Item2 Name="Release.Win32">
<MacroValues Count="1">
<Macro1 Name="LCLWidgetType" Value="win32"/>
</MacroValues>
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="../bin/PEBinaries/CentrED-plus (x32).exe"/>
<Filename Value="../Client.bin/CentrED"/>
</Target>
<SearchPaths>
<IncludeFiles Value="..;../obj;../Imaging;$(ProjOutDir)"/>
<IncludeFiles Value="$(ProjOutDir);../Imaging;.."/>
<OtherUnitFiles Value="..;../UOLib;../MulProvider;../Imaging;../Imaging/JpegLib;../Imaging/ZLib;Tools"/>
<UnitOutputDirectory Value="../obj/win32"/>
<UnitOutputDirectory Value="../obj/$(TargetCPU)-$(TargetOS)"/>
<SrcPath Value="$(LazarusDir)/lcl;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType);..;../UOLib;../MulProvider;../Imaging;../Imaging/JpegLib;../Imaging/ZLib;Tools"/>
</SearchPaths>
<Parsing>
@@ -46,7 +49,6 @@
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetProcessor Value="pentium4"/>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
<Optimizations>
@@ -70,21 +72,20 @@
<CompilerMessages>
<IgnoredMessages idx5028="True" idx5024="True" idx4081="True" idx4080="True" idx4079="True"/>
</CompilerMessages>
<CustomOptions Value="-FE../bin/PEBinaries/
-dNoLogging"/>
<CustomOptions Value="-dNoLogging"/>
</Other>
</CompilerOptions>
</Item2>
<Item3 Name="Release Win64">
<Item3 Name="Release.Win64">
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="../bin/PEBinaries/CentrED-plus (x64).exe"/>
<Filename Value="../Client.bin/CentrED"/>
</Target>
<SearchPaths>
<IncludeFiles Value="..;../obj;../Imaging;$(ProjOutDir)"/>
<IncludeFiles Value="$(ProjOutDir);../Imaging;.."/>
<OtherUnitFiles Value="..;../UOLib;../MulProvider;../Imaging;../Imaging/JpegLib;../Imaging/ZLib;Tools"/>
<UnitOutputDirectory Value="../obj/win64"/>
<UnitOutputDirectory Value="../obj/$(TargetCPU)-$(TargetOS)"/>
<SrcPath Value="$(LazarusDir)/lcl;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType);..;../UOLib;../MulProvider;../Imaging;../Imaging/JpegLib;../Imaging/ZLib;Tools"/>
</SearchPaths>
<Parsing>
@@ -94,7 +95,6 @@
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetProcessor Value="pentium4"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
@@ -104,6 +104,7 @@
<Linking>
<Debugging>
<GenerateDebugInfo Value="False"/>
<DebugInfoType Value="dsDwarf3"/>
<UseLineInfoUnit Value="False"/>
<StripSymbols Value="True"/>
</Debugging>
@@ -118,22 +119,24 @@
<CompilerMessages>
<IgnoredMessages idx5028="True" idx5024="True" idx4081="True" idx4080="True" idx4079="True"/>
</CompilerMessages>
<CustomOptions Value="-FE../bin/PEBinaries/
-dNoLogging"/>
<CustomOptions Value="-dNoLogging"/>
</Other>
</CompilerOptions>
</Item3>
<Item4 Name="Release Linux GTK2 x86">
<Item4 Name="Release.Linux.x86">
<MacroValues Count="1">
<Macro2 Name="LCLWidgetType" Value="gtk2"/>
</MacroValues>
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="../bin/PEBinaries/CentrED-plus"/>
<Filename Value="../Client.bin/CentrED.x86"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir);../Imaging;.."/>
<OtherUnitFiles Value="..;../UOLib;../MulProvider;../Imaging;../Imaging/JpegLib;../Imaging/ZLib;Tools;GUI"/>
<OtherUnitFiles Value="..;../UOLib;../MulProvider;../Imaging;../Imaging/JpegLib;../Imaging/ZLib;Tools"/>
<UnitOutputDirectory Value="../obj/$(TargetCPU)-$(TargetOS)"/>
<SrcPath Value="$(LazarusDir)/lcl;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)"/>
<SrcPath Value="$(LazarusDir)/lcl;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType);..;../UOLib;../MulProvider;../Imaging;../Imaging/JpegLib;../Imaging/ZLib;Tools"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
@@ -165,22 +168,24 @@
<CompilerMessages>
<IgnoredMessages idx5028="True" idx5024="True" idx4081="True" idx4080="True" idx4079="True"/>
</CompilerMessages>
<CustomOptions Value="-FE../bin/PEBinaries/
-dNoLogging"/>
<CustomOptions Value="-dNoLogging"/>
</Other>
</CompilerOptions>
</Item4>
<Item5 Name="Release Linux GTK2 x64">
<Item5 Name="Release.Linux.x64">
<MacroValues Count="1">
<Macro2 Name="LCLWidgetType" Value="gtk2"/>
</MacroValues>
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="../bin/PEBinaries/CentrED-plus"/>
<Filename Value="../Client.bin/CentrED.x64"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir);../Imaging;.."/>
<OtherUnitFiles Value="..;../UOLib;../MulProvider;../Imaging;../Imaging/JpegLib;../Imaging/ZLib;Tools;GUI"/>
<OtherUnitFiles Value="..;../UOLib;../MulProvider;../Imaging;../Imaging/JpegLib;../Imaging/ZLib;Tools"/>
<UnitOutputDirectory Value="../obj/$(TargetCPU)-$(TargetOS)"/>
<SrcPath Value="$(LazarusDir)/lcl;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)"/>
<SrcPath Value="$(LazarusDir)/lcl;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType);..;../UOLib;../MulProvider;../Imaging;../Imaging/JpegLib;../Imaging/ZLib;Tools"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
@@ -212,47 +217,162 @@
<CompilerMessages>
<IgnoredMessages idx5028="True" idx5024="True" idx4081="True" idx4080="True" idx4079="True"/>
</CompilerMessages>
<CustomOptions Value="-FE../bin/PEBinaries/
-dNoLogging"/>
<CustomOptions Value="-dNoLogging"/>
</Other>
</CompilerOptions>
</Item5>
<Item6 Name="Debug.Win32">
<MacroValues Count="1">
<Macro1 Name="LCLWidgetType" Value="win32"/>
</MacroValues>
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="../Client.bin/CentrED"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir);../Imaging;.."/>
<OtherUnitFiles Value="..;../UOLib;../MulProvider;../Imaging;../Imaging/JpegLib;../Imaging/ZLib;Tools"/>
<UnitOutputDirectory Value="../obj/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<CStyleOperator Value="False"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<Checks>
<OverflowChecks Value="True"/>
</Checks>
<TargetCPU Value="i386"/>
<TargetOS Value="win32"/>
</CodeGeneration>
<Other>
<CompilerMessages>
<IgnoredMessages idx5028="True" idx5024="True" idx4081="True" idx4080="True" idx4079="True"/>
</CompilerMessages>
</Other>
</CompilerOptions>
</Item6>
<Item7 Name="Debug.Linux.x86">
<MacroValues Count="1">
<Macro2 Name="LCLWidgetType" Value="gtk2"/>
</MacroValues>
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="../Client.bin/CentrED"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir);../Imaging;.."/>
<OtherUnitFiles Value="..;../UOLib;../MulProvider;../Imaging;../Imaging/JpegLib;../Imaging/ZLib;Tools"/>
<UnitOutputDirectory Value="../obj/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<CStyleOperator Value="False"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<Checks>
<OverflowChecks Value="True"/>
</Checks>
<TargetCPU Value="i386"/>
<TargetOS Value="linux"/>
</CodeGeneration>
<Other>
<CompilerMessages>
<IgnoredMessages idx5028="True" idx5024="True" idx4081="True" idx4080="True" idx4079="True"/>
</CompilerMessages>
<CustomOptions Value="-dNoLogging"/>
</Other>
</CompilerOptions>
</Item7>
<Item8 Name="Debug.Linux.x64">
<MacroValues Count="1">
<Macro2 Name="LCLWidgetType" Value="gtk2"/>
</MacroValues>
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="../Client.bin/CentrED"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir);../Imaging;.."/>
<OtherUnitFiles Value="..;../UOLib;../MulProvider;../Imaging;../Imaging/JpegLib;../Imaging/ZLib;Tools"/>
<UnitOutputDirectory Value="../obj/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<CStyleOperator Value="False"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<Checks>
<OverflowChecks Value="True"/>
</Checks>
<TargetCPU Value="x86_64"/>
<TargetOS Value="linux"/>
</CodeGeneration>
<Other>
<CompilerMessages>
<IgnoredMessages idx5028="True" idx5024="True" idx4081="True" idx4080="True" idx4079="True"/>
</CompilerMessages>
<CustomOptions Value="-dNoLogging"/>
</Other>
</CompilerOptions>
</Item8>
<SharedMatrixOptions Count="3">
<Item1 ID="851019893220" Modes="Release.Win32,Debug.Win32" Type="IDEMacro" MacroName="LCLWidgetType" Value="win32"/>
<Item2 ID="521965364444" Modes="Release.Linux.x86,Release.Linux.x64,Debug.Linux.x86,Debug.Linux.x64" Type="IDEMacro" MacroName="LCLWidgetType" Value="gtk2"/>
<Item3 ID="241840553479" Type="IDEMacro" MacroName="LCLWidgetType" Value="qt5"/>
</SharedMatrixOptions>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T &apos;Lazarus Run Output&apos; -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
<FormatVersion Value="2"/>
<Modes Count="1">
<Mode0 Name="default">
<local>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T &apos;Lazarus Run Output&apos; -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
<environment>
<UserOverrides Count="2">
<Variable0 Name="HEAPTRC" Value="log=CentrED.trc"/>
<Variable1 Name="WAYLAND_DISPLAY"/>
</UserOverrides>
</environment>
</Mode0>
</Modes>
</RunParams>
<RequiredPackages Count="6">
<Item1>
<PackageName Value="lclextensions_package"/>
<MinVersion Minor="3" Valid="True"/>
<PackageName Value="laz.virtualtreeview_package"/>
</Item1>
<Item2>
<PackageName Value="multiloglaz"/>
<PackageName Value="LCLBase"/>
<MinVersion Major="1" Release="1" Valid="True"/>
</Item2>
<Item3>
<PackageName Value="LazOpenGLContext"/>
<MinVersion Valid="True"/>
<PackageName Value="multiloglaz"/>
</Item3>
<Item4>
<PackageName Value="LCL"/>
<PackageName Value="LazOpenGLContext"/>
</Item4>
<Item5>
<PackageName Value="lnetvisual"/>
<MinVersion Minor="5" Release="3" Valid="True"/>
<PackageName Value="LCL"/>
</Item5>
<Item6>
<PackageName Value="laz.virtualtreeview_package"/>
<PackageName Value="lnetvisual"/>
<MinVersion Minor="5" Release="3" Valid="True"/>
</Item6>
</RequiredPackages>
<Units Count="60">
<Units Count="49">
<Unit0>
<Filename Value="CentrED.lpr"/>
<IsPartOfProject Value="True"/>
@@ -268,19 +388,21 @@
<Filename Value="UdmNetwork.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="dmNetwork"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="DataModule"/>
</Unit2>
<Unit3>
<Filename Value="UfrmLogin.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmLogin"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="UfrmLogin"/>
</Unit3>
<Unit4>
<Filename Value="UfrmInitialize.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmInitialize"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit4>
<Unit5>
@@ -294,24 +416,28 @@
<Filename Value="UfrmEditAccount.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmEditAccount"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit6>
<Unit7>
<Filename Value="Tools/UfrmDrawSettings.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmDrawSettings"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit7>
<Unit8>
<Filename Value="Tools/UfrmBoundaries.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmBoundaries"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit8>
<Unit9>
<Filename Value="Tools/UfrmElevateSettings.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmElevateSettings"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit9>
<Unit10>
@@ -319,282 +445,228 @@
<IsPartOfProject Value="True"/>
</Unit10>
<Unit11>
<Filename Value="UResourceManager.pas"/>
<IsPartOfProject Value="True"/>
</Unit11>
<Unit12>
<Filename Value="Tools/UfrmConfirmation.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmConfirmation"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit12>
<Unit13>
</Unit11>
<Unit12>
<Filename Value="Tools/UfrmMoveSettings.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmMoveSettings"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit13>
<Unit14>
</Unit12>
<Unit13>
<Filename Value="UfrmAbout.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmAbout"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit14>
<Unit15>
</Unit13>
<Unit14>
<Filename Value="Tools/UfrmHueSettings.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmHueSettings"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit15>
<Unit16>
</Unit14>
<Unit15>
<Filename Value="UfrmRadar.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmRadarMap"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit16>
<Unit17>
</Unit15>
<Unit16>
<Filename Value="UfrmLargeScaleCommand.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmLargeScaleCommand"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit17>
<Unit18>
</Unit16>
<Unit17>
<Filename Value="Tools/UfrmVirtualLayer.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmVirtualLayer"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit18>
<Unit19>
</Unit17>
<Unit18>
<Filename Value="Tools/UfrmFilter.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmFilter"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit18>
<Unit19>
<Filename Value="UGUIPlatformUtils.pas"/>
<IsPartOfProject Value="True"/>
</Unit19>
<Unit20>
<Filename Value="UGUIPlatformUtils.pas"/>
<Filename Value="UPlatformTypes.pas"/>
<IsPartOfProject Value="True"/>
</Unit20>
<Unit21>
<Filename Value="UPlatformTypes.pas"/>
<IsPartOfProject Value="True"/>
</Unit21>
<Unit22>
<Filename Value="UfrmRegionControl.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmRegionControl"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit21>
<Unit22>
<Filename Value="UPacketHandlers.pas"/>
<IsPartOfProject Value="True"/>
</Unit22>
<Unit23>
<Filename Value="UPacketHandlers.pas"/>
<Filename Value="UPackets.pas"/>
<IsPartOfProject Value="True"/>
</Unit23>
<Unit24>
<Filename Value="UPackets.pas"/>
<Filename Value="ULandscape.pas"/>
<IsPartOfProject Value="True"/>
</Unit24>
<Unit25>
<Filename Value="ULandscape.pas"/>
<Filename Value="UGameResources.pas"/>
<IsPartOfProject Value="True"/>
</Unit25>
<Unit26>
<Filename Value="UGameResources.pas"/>
<Filename Value="UAdminHandling.pas"/>
<IsPartOfProject Value="True"/>
</Unit26>
<Unit27>
<Filename Value="UAdminHandling.pas"/>
<IsPartOfProject Value="True"/>
</Unit27>
<Unit28>
<Filename Value="Tools/UfrmToolWindow.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmToolWindow"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit27>
<Unit28>
<Filename Value="../Logging.pas"/>
<IsPartOfProject Value="True"/>
</Unit28>
<Unit29>
<Filename Value="../Logging.pas"/>
<Filename Value="../UOLib/UStatics.pas"/>
<IsPartOfProject Value="True"/>
</Unit29>
<Unit30>
<Filename Value="../UOLib/UStatics.pas"/>
<Filename Value="../UOLib/UWorldItem.pas"/>
<IsPartOfProject Value="True"/>
</Unit30>
<Unit31>
<Filename Value="../UOLib/UWorldItem.pas"/>
<Filename Value="../UOLib/UMap.pas"/>
<IsPartOfProject Value="True"/>
</Unit31>
<Unit32>
<Filename Value="../UOLib/UMap.pas"/>
<Filename Value="../UOLib/UTiledata.pas"/>
<IsPartOfProject Value="True"/>
</Unit32>
<Unit33>
<Filename Value="../UOLib/UTiledata.pas"/>
<Filename Value="UGLFont.pas"/>
<IsPartOfProject Value="True"/>
</Unit33>
<Unit34>
<Filename Value="UGLFont.pas"/>
<Filename Value="../UOLib/UAnimData.pas"/>
<IsPartOfProject Value="True"/>
</Unit34>
<Unit35>
<Filename Value="../UOLib/UAnimData.pas"/>
<Filename Value="../MulProvider/UTileDataProvider.pas"/>
<IsPartOfProject Value="True"/>
</Unit35>
<Unit36>
<Filename Value="../MulProvider/UTileDataProvider.pas"/>
<Filename Value="../MulProvider/UAnimDataProvider.pas"/>
<IsPartOfProject Value="True"/>
</Unit36>
<Unit37>
<Filename Value="../MulProvider/UAnimDataProvider.pas"/>
<Filename Value="../MulProvider/UMulManager.pas"/>
<IsPartOfProject Value="True"/>
</Unit37>
<Unit38>
<Filename Value="../MulProvider/UMulManager.pas"/>
<Filename Value="../MulProvider/UArtProvider.pas"/>
<IsPartOfProject Value="True"/>
</Unit38>
<Unit39>
<Filename Value="../MulProvider/UArtProvider.pas"/>
<Filename Value="../MulProvider/UTexmapProvider.pas"/>
<IsPartOfProject Value="True"/>
</Unit39>
<Unit40>
<Filename Value="../MulProvider/UTexmapProvider.pas"/>
<Filename Value="../version.inc"/>
<IsPartOfProject Value="True"/>
</Unit40>
<Unit41>
<Filename Value="../version.inc"/>
<Filename Value="ULightManager.pas"/>
<IsPartOfProject Value="True"/>
</Unit41>
<Unit42>
<Filename Value="ULightManager.pas"/>
<Filename Value="../UOLib/ULight.pas"/>
<IsPartOfProject Value="True"/>
</Unit42>
<Unit43>
<Filename Value="../UOLib/ULight.pas"/>
<Filename Value="../MulProvider/ULightProvider.pas"/>
<IsPartOfProject Value="True"/>
</Unit43>
<Unit44>
<Filename Value="../MulProvider/ULightProvider.pas"/>
<IsPartOfProject Value="True"/>
</Unit44>
<Unit45>
<Filename Value="Tools/UfrmLightlevel.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmLightlevel"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit44>
<Unit45>
<Filename Value="UfrmChangePassword.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmChangePassword"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit45>
<Unit46>
<Filename Value="../UEnhancedMemoryStream.pas"/>
<Filename Value="USelectionHelper.pas"/>
<IsPartOfProject Value="True"/>
</Unit46>
<Unit47>
<Filename Value="UndoRedoCmd.pas"/>
<Filename Value="UActions.pas"/>
<IsPartOfProject Value="True"/>
</Unit47>
<Unit48>
<Filename Value="../UOLib/UArt.pas"/>
<Filename Value="UUoaDesigns.pas"/>
<IsPartOfProject Value="True"/>
</Unit48>
<Unit49>
<Filename Value="../vinfo.pas"/>
<IsPartOfProject Value="True"/>
</Unit49>
<Unit50>
<Filename Value="language.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="Language"/>
</Unit50>
<Unit51>
<Filename Value="Tools/UfrmFillSettings.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmFillSettings"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit51>
<Unit52>
<Filename Value="Tools/UfrmSelectionSettings.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmSelectionSettings"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit52>
<Unit53>
<Filename Value="Tools/UfrmSurfStretchSettings.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmSurfStretchSettings"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit53>
<Unit54>
<Filename Value="Tools/UfrmSurfElevateSettings.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmSurfElevateSettings"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit54>
<Unit55>
<Filename Value="Tools/UfrmSurfSmoothSettings.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmSurfSmoothSettings"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit55>
<Unit56>
<Filename Value="Crc32Hash.pas"/>
<IsPartOfProject Value="True"/>
</Unit56>
<Unit57>
<Filename Value="../UOLib/UUopFile.pas"/>
<IsPartOfProject Value="True"/>
</Unit57>
<Unit58>
<Filename Value="GUI/AeroGlass.pas"/>
<IsPartOfProject Value="True"/>
</Unit58>
<Unit59>
<Filename Value="GUI/VirtualList.pas"/>
<IsPartOfProject Value="True"/>
</Unit59>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="../bin/PEBinaries/CentrED-plus"/>
<Filename Value="../Client.bin/CentrED"/>
</Target>
<SearchPaths>
<IncludeFiles Value="..;../obj;../Imaging;$(ProjOutDir)"/>
<OtherUnitFiles Value="Tools;..;../UOLib;../Server;../MulProvider;../Imaging;../Imaging/JpegLib;../Imaging/ZLib;GUI"/>
<UnitOutputDirectory Value="../obj"/>
<IncludeFiles Value="$(ProjOutDir);../Imaging;.."/>
<OtherUnitFiles Value="..;../UOLib;../MulProvider;../Imaging;../Imaging/JpegLib;../Imaging/ZLib;Tools"/>
<UnitOutputDirectory Value="../obj/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<UseAnsiStrings Value="False"/>
<CStyleOperator Value="False"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<Checks>
<RangeChecks Value="True"/>
<OverflowChecks Value="True"/>
</Checks>
<Optimizations>
<OptimizationLevel Value="3"/>
<OptimizationLevel Value="0"/>
</Optimizations>
</CodeGeneration>
<Linking>
<Debugging>
<DebugInfoType Value="dsStabs"/>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<CompilerMessages>
<IgnoredMessages idx5028="True" idx5024="True" idx4081="True" idx4080="True" idx4079="True"/>
</CompilerMessages>
<CustomOptions Value="-FE../bin/PEBinaries/
+-dNoLogging"/>
<CustomOptions Value="-B"/>
</Other>
</CompilerOptions>
</CONFIG>
+13 -96
View File
@@ -21,122 +21,39 @@
* CDDL HEADER END
*
*
* Portions Copyright 2015 Andreas Schneider
* Portions Copyright 2015 StaticZ
* Portions Copyright 2012 Andreas Schneider
*)
program CentrED;
{$mode objfpc}{$H+}
uses
{$IFNDEF NoLogging}heaptrc, Logging, filechannel,{$ENDIF}
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes, SysUtils,
SysUtils,
Interfaces, // this includes the LCL widgetset
LCLType, Forms, Dialogs, UdmNetwork, UResourceManager, Graphics;
Forms, UdmNetwork;
{$R CentrED.res}
//{$R CentrED.manifest.rc}
{$R Assets.rc} // Beware: you need 'windres', which is part of mingw-binutils on *nix!
function GetApplicationName: String;
begin
Result := 'CentrED-plus';
end;
function LoadCursorFromRes(AFileName: string; CurFormat: Boolean = True): HCURSOR;
type
TIconHeader = packed record
hReserved: WORD; // = 0
hType: WORD; // ICO = 1, CUR = 2
hCount: WORD;
end;
TIconInfo = packed record
iWidth: BYTE;
iHeight: BYTE;
iColors: BYTE;
iReserved: BYTE; // = 0
iHotspotX: WORD; // CUR file (/iPlanes for ICO)
iHotspotY: WORD; // CUR file (/iBpp for ICO)
iSize: Cardinal;
iOffset: Cardinal;
end;
var
stream: TStream;
(*dwSize: Integer;
buffer: array of Byte;
header: TIconHeader;
icoinf: TIconInfo; *) //TODO Cleanup
cursorImage: TCursorImage;
begin
stream := ResourceManager.GetResource(AFileName);
(*dwSize := stream.Size;
SetLength(buffer, dwSize + 8);
stream.Read(buffer[0], dwSize);
if not CurFormat then
Result := HCURSOR(CreateIconFromResource(@buffer[0], dwSize, False, $00030000))
else begin
CopyMemory(@header, @buffer[0], SizeOf(TIconHeader));
// Грузим последнее изображение, которое обычно должно являться первым и единственным в иконках
CopyMemory(@icoinf, @buffer[SizeOf(TIconHeader) + (header.hCount - 1) * SizeOf(TIconInfo)], SizeOf(TIconInfo));
CopyMemory(@buffer[icoinf.iOffset-4], @icoinf.iHotspotX, 2);
CopyMemory(@buffer[icoinf.iOffset-2], @icoinf.iHotspotY, 2);
Result := HCURSOR(CreateIconFromResource(@buffer[icoinf.iOffset-4], icoinf.iSize+4, False, $00030000))
end;*)
try
cursorImage := TCursorImage.Create;
cursorImage.LoadFromStream(stream);
Result := cursorImage.ReleaseHandle;
finally
cursorImage.Free;
end;
Result := 'CentrED';
end;
begin
Application.Title:='CentrED+';
{$IFNDEF NoLogging}
SetHeapTraceOutput('CentrED.trc');
Logger.Channels.Add(TFileChannel.Create('CentrED.log'));
{$ENDIF}
OnGetApplicationName := @GetApplicationName;
Application.Scaled:=True;
Application.Initialize;
{if LowerCase(ChangeFileExt(ExtractFileName(ParamStr(0)), '')) <> LowerCase(GetApplicationName) then
begin
MessageDlg('Bug', 'The executable file has been renamed. Rename ' +
'file as follows: "' +
GetApplicationName + '.exe"', mtError, [mbOK], 0);
Application.Terminate;
end;} //TODO Why?
if Paramcount = 1 then begin
MessageDlg('Startup options', ParamStr(1), mtError, [mbOK], 0);
end;
// Loading cursors ...
Screen.Cursors[-02] := LoadCursorFromRes('Cursors/BC_NormalSelect.cur'); //crArrow
Screen.Cursors[-19] := LoadCursorFromRes('Cursors/BC_WorkingInBackground.cur'); //crAppStart
Screen.Cursors[-20] := LoadCursorFromRes('Cursors/BC_HelpSelect.cur'); //crHelp
//Screen.Cursors[-12] := LoadCursorFromRes('Cursors/.cur'); //crDrag
//Screen.Cursors[-16] := LoadCursorFromRes('Cursors/.cur'); //crMultiDrag
//Screen.Cursors[-13] := LoadCursorFromRes('Cursors/.cur'); //crNoDrop
Screen.Cursors[-03] := LoadCursorFromRes('Cursors/BC_PrecisionSelect.cur'); //crCross
Screen.Cursors[-04] := LoadCursorFromRes('Cursors/BC_TextSelect.cur'); //crIBeam
//TODO Screen.Cursors[-11] := LoadCursorFromRes('Cursors/BI_Busy.ani', False); //crHourGlass
Screen.Cursors[-18] := LoadCursorFromRes('Cursors/TN_Unavailable.cur'); //crNo
Screen.Cursors[-22] := LoadCursorFromRes('Cursors/BC_Move.cur'); //crSize
Screen.Cursors[-06] := LoadCursorFromRes('Cursors/BC_DiagonalResize2.cur'); //crSizeNESW
Screen.Cursors[-07] := LoadCursorFromRes('Cursors/BC_VerticalResize.cur'); //crSizeNS
Screen.Cursors[-08] := LoadCursorFromRes('Cursors/BC_DiagonalResize1.cur'); //crSizeNWSE
Screen.Cursors[-09] := LoadCursorFromRes('Cursors/BC_HorizontalResize.cur'); //crSizeWE
Screen.Cursors[-10] := LoadCursorFromRes('Cursors/BC_AlternateSelect.cur'); //crUpArrow
//Screen.Cursors[-14] := LoadCursorFromRes('Cursors/.cur'); //crHSplit
//Screen.Cursors[-15] := LoadCursorFromRes('Cursors/.cur'); //crVSplit
Screen.Cursors[-21] := LoadCursorFromRes('Cursors/TN_LinkSelect.cur'); //crHandPoint
Screen.Cursors[+01] := LoadCursorFromRes('Cursors/UO_Precision.cur');
Screen.Cursors[+02] := LoadCursorFromRes('Cursors/UO_AttackMode.cur');
Screen.Cursors[+03] := LoadCursorFromRes('Cursors/UO_Gauntlet.cur');
// Run the program...
Application.CreateForm(TdmNetwork, dmNetwork);
Application.Run;
end.
+2 -7
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="CompanyName.ProductName.YourApp" type="win32"/>
<description>Your application description here.</description>
@@ -10,13 +10,8 @@
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requestedexecutionlevel" uiAccess="false"/>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
-194
View File
@@ -1,194 +0,0 @@
unit Crc32Hash;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Dialogs;
procedure CalcCRC32(p: Pointer; ByteCount: DWORD; var CRCValue: DWORD);
function CalcStringCRC32(s: string; out CRC32: DWORD): Boolean;
procedure CalcFileCRC32(FromName: string; var CRCvalue: DWORD; var TotalBytes: Int64; var error: Word);
implementation
// The constants here are for the CRC-32 generator
// polynomial, as defined in the Microsoft
// Systems Journal, March 1995, pp. 107 - 108
const
Table: array[0..255] of DWORD =
($00000000, $77073096, $EE0E612C, $990951BA,
$076DC419, $706AF48F, $E963A535, $9E6495A3,
$0EDB8832, $79DCB8A4, $E0D5E91E, $97D2D988,
$09B64C2B, $7EB17CBD, $E7B82D07, $90BF1D91,
$1DB71064, $6AB020F2, $F3B97148, $84BE41DE,
$1ADAD47D, $6DDDE4EB, $F4D4B551, $83D385C7,
$136C9856, $646BA8C0, $FD62F97A, $8A65C9EC,
$14015C4F, $63066CD9, $FA0F3D63, $8D080DF5,
$3B6E20C8, $4C69105E, $D56041E4, $A2677172,
$3C03E4D1, $4B04D447, $D20D85FD, $A50AB56B,
$35B5A8FA, $42B2986C, $DBBBC9D6, $ACBCF940,
$32D86CE3, $45DF5C75, $DCD60DCF, $ABD13D59,
$26D930AC, $51DE003A, $C8D75180, $BFD06116,
$21B4F4B5, $56B3C423, $CFBA9599, $B8BDA50F,
$2802B89E, $5F058808, $C60CD9B2, $B10BE924,
$2F6F7C87, $58684C11, $C1611DAB, $B6662D3D,
$76DC4190, $01DB7106, $98D220BC, $EFD5102A,
$71B18589, $06B6B51F, $9FBFE4A5, $E8B8D433,
$7807C9A2, $0F00F934, $9609A88E, $E10E9818,
$7F6A0DBB, $086D3D2D, $91646C97, $E6635C01,
$6B6B51F4, $1C6C6162, $856530D8, $F262004E,
$6C0695ED, $1B01A57B, $8208F4C1, $F50FC457,
$65B0D9C6, $12B7E950, $8BBEB8EA, $FCB9887C,
$62DD1DDF, $15DA2D49, $8CD37CF3, $FBD44C65,
$4DB26158, $3AB551CE, $A3BC0074, $D4BB30E2,
$4ADFA541, $3DD895D7, $A4D1C46D, $D3D6F4FB,
$4369E96A, $346ED9FC, $AD678846, $DA60B8D0,
$44042D73, $33031DE5, $AA0A4C5F, $DD0D7CC9,
$5005713C, $270241AA, $BE0B1010, $C90C2086,
$5768B525, $206F85B3, $B966D409, $CE61E49F,
$5EDEF90E, $29D9C998, $B0D09822, $C7D7A8B4,
$59B33D17, $2EB40D81, $B7BD5C3B, $C0BA6CAD,
$EDB88320, $9ABFB3B6, $03B6E20C, $74B1D29A,
$EAD54739, $9DD277AF, $04DB2615, $73DC1683,
$E3630B12, $94643B84, $0D6D6A3E, $7A6A5AA8,
$E40ECF0B, $9309FF9D, $0A00AE27, $7D079EB1,
$F00F9344, $8708A3D2, $1E01F268, $6906C2FE,
$F762575D, $806567CB, $196C3671, $6E6B06E7,
$FED41B76, $89D32BE0, $10DA7A5A, $67DD4ACC,
$F9B9DF6F, $8EBEEFF9, $17B7BE43, $60B08ED5,
$D6D6A3E8, $A1D1937E, $38D8C2C4, $4FDFF252,
$D1BB67F1, $A6BC5767, $3FB506DD, $48B2364B,
$D80D2BDA, $AF0A1B4C, $36034AF6, $41047A60,
$DF60EFC3, $A867DF55, $316E8EEF, $4669BE79,
$CB61B38C, $BC66831A, $256FD2A0, $5268E236,
$CC0C7795, $BB0B4703, $220216B9, $5505262F,
$C5BA3BBE, $B2BD0B28, $2BB45A92, $5CB36A04,
$C2D7FFA7, $B5D0CF31, $2CD99E8B, $5BDEAE1D,
$9B64C2B0, $EC63F226, $756AA39C, $026D930A,
$9C0906A9, $EB0E363F, $72076785, $05005713,
$95BF4A82, $E2B87A14, $7BB12BAE, $0CB61B38,
$92D28E9B, $E5D5BE0D, $7CDCEFB7, $0BDBDF21,
$86D3D2D4, $F1D4E242, $68DDB3F8, $1FDA836E,
$81BE16CD, $F6B9265B, $6FB077E1, $18B74777,
$88085AE6, $FF0F6A70, $66063BCA, $11010B5C,
$8F659EFF, $F862AE69, $616BFFD3, $166CCF45,
$A00AE278, $D70DD2EE, $4E048354, $3903B3C2,
$A7672661, $D06016F7, $4969474D, $3E6E77DB,
$AED16A4A, $D9D65ADC, $40DF0B66, $37D83BF0,
$A9BCAE53, $DEBB9EC5, $47B2CF7F, $30B5FFE9,
$BDBDF21C, $CABAC28A, $53B39330, $24B4A3A6,
$BAD03605, $CDD70693, $54DE5729, $23D967BF,
$B3667A2E, $C4614AB8, $5D681B02, $2A6F2B94,
$B40BBE37, $C30C8EA1, $5A05DF1B, $2D02EF8D);
type
TInteger8 = Int64;
{
//----------------------------------crc32----------------------------------
{$IFDEF VER130} // This is a bit awkward
// 8-byte integer
TInteger8 = Int64; // Delphi 5
{$ELSE}
{$IFDEF VER120}
TInteger8 = Int64; // Delphi 4
{$ELSE}
TInteger8 = COMP; // Delphi 2 or 3
{$ENDIF}
{$ENDIF}
}
//----------------------------------crc32----------------------------------
// Use CalcCRC32 as a procedure so CRCValue can be passed in but
// also returned. This allows multiple calls to CalcCRC32 for
// the "same" CRC-32 calculation.
procedure CalcCRC32(p: Pointer; ByteCount: DWORD; var CRCValue: DWORD);
// The following is a little cryptic (but executes very quickly).
// The algorithm is as follows:
// 1. exclusive-or the input byte with the low-order byte of
// the CRC register to get an INDEX
// 2. shift the CRC register eight bits to the right
// 3. exclusive-or the CRC register with the contents of Table[INDEX]
// 4. repeat steps 1 through 3 for all bytes
var
i: DWORD;
q: ^BYTE;
begin
q := p;
for i := 0 to ByteCount - 1 do
begin
CRCvalue := (CRCvalue shr 8) xor
Table[q^ xor (CRCvalue and $000000FF)];
Inc(q)
end
end {CalcCRC32};
function CalcStringCRC32(s: string; out CRC32: DWORD): Boolean;
var
CRC32Table: DWORD;
begin
// Verify the table used to compute the CRCs has not been modified.
// Thanks to Gary Williams for this suggestion, Jan. 2003.
CRC32Table := $FFFFFFFF;
CalcCRC32(Addr(Table[0]), SizeOf(Table), CRC32Table);
CRC32Table := not CRC32Table;
if CRC32Table <> $6FCF9E13 then
{$IFDEF ResBuilder}
writeln('!!! CRC32 Table CRC32 is ' + IntToHex(Crc32Table, 8) + ', expecting $6FCF9E13')
{$ELSE}
ShowMessage('CRC32 Table CRC32 is ' + IntToHex(Crc32Table, 8) + ', expecting $6FCF9E13')
{$ENDIF}
else
begin
CRC32 := $FFFFFFFF; // To match PKZIP
if Length(s) > 0 {// Avoid access violation in D4 } then
CalcCRC32(Addr(s[1]), Length(s), CRC32);
CRC32 := not CRC32; // To match PKZIP
Result := True;
end;
//ShowMessage('Get CRC is = ' + IntToStr(CRC32));
end;
procedure CalcFileCRC32(FromName: string; var CRCvalue: DWORD;
var TotalBytes: TInteger8;
var error: Word);
var
Stream: TMemoryStream;
begin
error := 0;
CRCValue := $FFFFFFFF;
Stream := TMemoryStream.Create;
try
try
Stream.LoadFromFile(FromName);
if Stream.Size > 0 then
CalcCRC32(Stream.Memory, Stream.Size, CRCvalue)
except
on E: EReadError do
error := 1
end;
CRCvalue := not CRCvalue
finally
Stream.Free
end;
end;
{
procedure TForm1.Button1Click(Sender: TObject);
var
s: string;
CRC32: DWORD;
begin
s := 'Test String';
if CalcStringCRC32(s, CRC32) then
ShowMessage(IntToStr(crc32));
end;
}
end.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.
Binary file not shown.
-222
View File
@@ -1,222 +0,0 @@
unit AeroGlass;
{$mode delphi}
//{$mode objfpc}{$H+}
interface
uses
//Windows, Forms, Graphics;
// os
Windows, UxTheme, ShellAPI, Win32Proc, Win32Extra,
// rtl
Classes, SysUtils,
// lcl
Forms, Controls, Graphics, Themes;//, LCLProc, LCLType;
type
_MARGINS = packed record
cxLeftWidth : Integer;
cxRightWidth : Integer;
cyTopHeight : Integer;
cyBottomHeight : Integer;
end;
PMargins = ^_MARGINS;
TMargins = _MARGINS;
DwmIsCompositionEnabledFunc = function(pfEnabled: PBoolean): HRESULT; stdcall;
DwmExtendFrameIntoClientAreaFunc = function(destWnd: HWND; const pMarInset: PMargins): HRESULT; stdcall;
SetLayeredWindowAttributesFunc = function(destWnd: HWND; cKey: TColor; bAlpha: Byte; dwFlags: DWord): BOOL; stdcall;
const
WS_EX_LAYERED = $80000;
LWA_COLORKEY = 1;
procedure GlassFormEx(frm: TForm; tmpMargins: TMargins; cBlurColorKey: TColor = clFuchsia);
procedure GlassForm(frm: TForm; cBlurColorKey: TColor = clFuchsia);
function WindowsAeroGlassCompatible: Boolean;
function CreateBitmap32(DC: HDC; W, H: Integer; var BitmapBits: Pointer): HBITMAP;
procedure DrawAlphaText(wnd: hwnd; DC: HDC; x,y: integer; txt: WideString);
implementation
// =============================================================================
// == Преобразование формы в AeroGlass
// =============================================================================
function WindowsAeroGlassCompatible: Boolean;
var
osVinfo: TOSVERSIONINFO;
begin
ZeroMemory(@osVinfo, SizeOf(osVinfo));
OsVinfo.dwOSVersionInfoSize := SizeOf(TOSVERSIONINFO);
if (
(GetVersionEx(osVInfo) = True) and
(osVinfo.dwPlatformId = VER_PLATFORM_WIN32_NT) and
(osVinfo.dwMajorVersion >= 6)
)
then Result:=True
else Result:=False;
end;
procedure GlassFormEx(frm: TForm; tmpMargins: TMargins; cBlurColorKey: TColor = clFuchsia);
var
hDwmDLL: Cardinal;
fDwmIsCompositionEnabled: DwmIsCompositionEnabledFunc;
fDwmExtendFrameIntoClientArea: DwmExtendFrameIntoClientAreaFunc;
fSetLayeredWindowAttributesFunc: SetLayeredWindowAttributesFunc;
bCmpEnable: Boolean;
mgn: TMargins;
begin
{ Continue if Windows version is compatible }
if WindowsAeroGlassCompatible then begin
{ Continue if 'dwmapi' library is loaded }
hDwmDLL := LoadLibrary('dwmapi.dll');
if hDwmDLL <> 0 then begin
{ Get values }
@fDwmIsCompositionEnabled := GetProcAddress(hDwmDLL, 'DwmIsCompositionEnabled');
@fDwmExtendFrameIntoClientArea := GetProcAddress(hDwmDLL, 'DwmExtendFrameIntoClientArea');
@fSetLayeredWindowAttributesFunc := GetProcAddress(GetModulehandle(user32), 'SetLayeredWindowAttributes');
{ Continue if values are <> nil }
if (
(@fDwmIsCompositionEnabled <> nil) and
(@fDwmExtendFrameIntoClientArea <> nil) and
(@fSetLayeredWindowAttributesFunc <> nil)
)
then begin
{ Continue if composition is enabled }
fDwmIsCompositionEnabled(@bCmpEnable);
if bCmpEnable = True then begin
{ Set Form Color same as cBlurColorKey }
frm.Color := cBlurColorKey;
{ ... }
SetWindowLong(frm.Handle, GWL_EXSTYLE, GetWindowLong(frm.Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
{ ... }
fSetLayeredWindowAttributesFunc(frm.Handle, cBlurColorKey, 0, LWA_COLORKEY);
{ Set margins }
ZeroMemory(@mgn, SizeOf(mgn));
mgn.cxLeftWidth := tmpMargins.cxLeftWidth;
mgn.cxRightWidth := tmpMargins.cxRightWidth;
mgn.cyTopHeight := tmpMargins.cyTopHeight;
mgn.cyBottomHeight := tmpMargins.cyBottomHeight;
{ Extend Form }
fDwmExtendFrameIntoClientArea(frm.Handle,@mgn);
end;
end;
{ Free loaded 'dwmapi' library }
FreeLibrary(hDWMDLL);
end;
end;
end;
procedure GlassForm(frm: TForm; cBlurColorKey: TColor = clFuchsia);
var
tmpMargins: TMargins;
begin
{ If all margins are -1 the whole form will be aero glass}
tmpMargins.cxLeftWidth := 8;
tmpMargins.cxRightWidth := 8;
tmpMargins.cyBottomHeight := 25;
tmpMargins.cyTopHeight := 4;
{ FormName ; Margins ; TransparentColor }
GlassFormEx(frm, tmpMargins, cBlurColorKey);
end;
// =============================================================================
// == Вывод текста и изображений на форме AeroGlass
// =============================================================================
function CreateBitmap32(DC: HDC; W, H: Integer; var BitmapBits: Pointer): HBITMAP;
var
bi: BITMAPINFO;
begin
ZeroMemory(@bi, sizeof(BITMAPINFO));
with bi.bmiHeader do
begin
biSize := sizeof(BITMAPINFOHEADER);
biWidth := W;
biHeight := -H;
biCompression := BI_RGB;
biBitCount := 32;
biPlanes := 1;
biXPelsPerMeter := 0;
biYPelsPerMeter := 0;
biClrUsed := 0;
biClrImportant := 0;
end;
Result := CreateDIBSection(DC, bi, DIB_RGB_COLORS, BitmapBits, 0, 0);
end;
type
TDTTOpts = record
dwSize: Longword;
dwFlags: Longword;
crText: Longword;
crBorder: Longword;
crShadow: Longword;
eTextShadowType: Integer;
ptShadowOffset: TPoint;
iBorderSize: Integer;
iFontPropId: Integer;
iColorPropId: Integer;
iStateId: Integer;
fApplyOverlay: Integer;
iGlowSize: Integer;
pfnDrawTextCallback: Pointer;
lParam: Integer;
end;
var
hTheme: THandle;
procedure DrawAlphaText(wnd: hwnd; DC: HDC; x,y: integer; txt: WideString);
var
tr: trect;
txtOptions: TDTTOPTS;
hBmp: HBITMAP;
hBmpDC: HDC;
hFnt: HFont;
p: pointer;
ts: SIZE;
begin
hTheme := OpenThemeData(wnd, 'window');
hBmpDC := CreateCompatibleDC(0);
hFnt := CreateFont(-MulDiv(10, GetDeviceCaps(hBmpDC, LOGPIXELSY), 72), 0, 0, 0, FW_BOLD {FW_NORMAL}, 0, 0, 0,
DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, 'arial');
SelectObject(hBmpDC, hFnt);
GetTextExtentPointW(hBmpDC, PWideChar(txt), length(txt), ts);
SetRect(tr, 0, 0, ts.cx + 5, ts.cy + 5);
hBmp := CreateBitmap32(hBmpDC, tr.Right, tr.Bottom, p);
SelectObject(hBmpDC, hBmp);
ZeroMemory(@txtOptions, sizeof(TDTTOPTS));
txtOptions.dwSize := sizeof(TDTTOPTS);
txtOptions.dwFlags := DTT_COMPOSITED or DTT_GLOWSIZE or DTT_TEXTCOLOR;
txtOptions.iGlowSize := 5;
txtOptions.crText := $00FF0000;
DrawThemeTextEx(hTheme, hBmpDC, 0, 0, PWideChar(txt), length(txt), DT_SINGLELINE or DT_vCENTER, @tr, @txtOptions);
BitBlt(dc, x, y, tr.Right, tr.Bottom, hBmpDC, 0, 0, SRCCOPY);
DeleteObject(hBmpDC);
DeleteObject(hBmp);
DeleteObject(hFnt);
CloseThemeData(hTheme);
end;
end.
-368
View File
@@ -1,368 +0,0 @@
unit GlowLabel;
{******************************************************************}
{ GlowLabel }
{ }
{ home page : http://www.winningcubed.de }
{ email : martin.walter@winningcubed.de }
{ }
{ date : 15-04-2007 }
{ }
{ version : 1.0 }
{ }
{ Use of this file is permitted for commercial and non-commercial }
{ use, as long as the author is credited. }
{ This file (c) 2007 Martin Walter }
{ }
{ This Software is distributed on an "AS IS" basis, WITHOUT }
{ WARRANTY OF ANY KIND, either express or implied. }
{ }
{ *****************************************************************}
interface
uses
Windows, Classes, StdCtrls {$IFDEF USETNT}, TntStdCtrls{$ENDIF};
type
TCustomGlowLabel = class({$IFDEF USETNT}TTntCustomLabel{$ELSE}TCustomLabel{$ENDIF})
private
FGlow: Boolean;
FGlowSize: Integer;
FOldGlowSize: Integer;
FBoundsWithGlow: Boolean;
procedure SetGlow(const Value: Boolean);
procedure SetGlowSize(const Value: Integer);
function IsGlow: Boolean;
function GetExpansion(GlowSize: Integer): Integer;
protected
procedure DoDrawText(var Rect: TRect; Flags: Longint); override;
procedure AdjustBounds; override;
property Glow: Boolean read FGlow write SetGlow;
property GlowSize: Integer read FGlowSize write SetGlowSize;
public
constructor Create(AOwner: TComponent); override;
end;
TGlowLabel = class(TCustomGlowLabel)
published
property Align;
property Alignment;
property Anchors;
property AutoSize;
property BiDiMode;
property Caption;
property Color nodefault;
property Constraints;
property DragCursor;
property DragKind;
property DragMode;
property EllipsisPosition;
property Enabled;
property FocusControl;
property Font;
property Glow;
property GlowSize;
property ParentBiDiMode;
property ParentColor;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowAccelChar;
property ShowHint;
property Transparent;
property Layout;
property Visible;
property WordWrap;
property OnClick;
property OnContextPopup;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnMouseActivate;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnMouseEnter;
property OnMouseLeave;
property OnStartDock;
property OnStartDrag;
end;
procedure Register;
implementation
uses
Controls, Forms, Graphics, SysUtils, Math, DwmApi, Themes, UxTheme;
function StrScanW(const Str: PWideChar; Chr: WideChar): PWideChar;
begin
Result := Str;
while Result^ <> Chr do
begin
if Result^ = #0 then
begin
Result := nil;
Exit;
end;
Inc(Result);
end;
end;
function LastDelimiterW(const Delimiters, S: WideString): Integer;
var
P: PWideChar;
begin
Result := Length(S);
P := PWideChar(Delimiters);
while Result > 0 do
begin
if (S[Result] <> #0) and (StrScanW(P, S[Result]) <> nil) then
Exit;
Dec(Result);
end;
end;
{ TGlowCustomLabel }
procedure TCustomGlowLabel.AdjustBounds;
const
WordWraps: array[Boolean] of Word = (0, DT_WORDBREAK);
var
DC: HDC;
Rect, Bounds, CalcRect: TRect;
AAlignment: TAlignment;
Expand: Integer;
DoSetBounds: Boolean;
begin
DoSetBounds := False;
Bounds := BoundsRect;
Rect := Bounds;
if (IsGlow and (csReading in ComponentState)) then
begin
FBoundsWithGlow := True;
FOldGlowSize := FGlowSize;
end;
if FBoundsWithGlow then
begin
Expand := GetExpansion(FOldGlowSize);
Inc(Rect.Left, Expand);
Inc(Rect.Top, Expand);
Dec(Rect.Right, Expand);
Dec(Rect.Bottom, Expand);
FBoundsWithGlow := False;
DoSetBounds := True;
end;
if not ((csReading in ComponentState) or
(csLoading in ComponentState)) and
AutoSize then
begin
DC := GetDC(0);
Canvas.Handle := DC;
CalcRect.Left := 0;
CalcRect.Top := 0;
DoDrawText(CalcRect, (DT_EXPANDTABS or DT_CALCRECT) or WordWraps[WordWrap]);
Canvas.Handle := 0;
ReleaseDC(0, DC);
AAlignment := Alignment;
if UseRightToLeftAlignment then
ChangeBiDiModeAlignment(AAlignment);
if AAlignment = taRightJustify then
Rect.Left := Rect.Right - CalcRect.Right;
Rect.Right := Rect.Left + CalcRect.Right;
Rect.Bottom := Rect.Top + CalcRect.Bottom;
DoSetBounds := True;
end;
if IsGlow then
begin
FBoundsWithGlow := True;
Expand := GetExpansion(FGlowSize);
Dec(Rect.Left, Expand);
Dec(Rect.Top, Expand);
Inc(Rect.Right, Expand);
Inc(Rect.Bottom, Expand);
FOldGlowSize := FGlowSize;
DoSetBounds := True;
end;
if DoSetBounds then
SetBounds(Rect.Left, Rect.Top, Rect.Right - Rect.Left, Rect.Bottom - Rect.Top);
end;
constructor TCustomGlowLabel.Create(AOwner: TComponent);
begin
inherited;
FGlow := False;
FGlowSize := 10;
FOldGlowSize := 0;
FBoundsWithGlow := False;
end;
procedure TCustomGlowLabel.DoDrawText(var Rect: TRect; Flags: Integer);
procedure DoDrawThemeTextEx(DC: HDC; const Text: WideString; TextLen: Integer;
var TextRect: TRect; TextFlags: Cardinal);
var
Options: TDTTOpts;
begin
FillChar(Options, SizeOf(Options), 0);
Options.dwSize := SizeOf(Options);
Options.dwFlags := DTT_TEXTCOLOR or DTT_COMPOSITED;
if IsGlow then
begin
Options.dwFlags := Options.dwFlags or DTT_GLOWSIZE;
Options.iGlowSize := FGlowSize;
end;
Options.crText := ColorToRGB(Canvas.Font.Color);
with ThemeServices.GetElementDetails(teEditTextNormal) do
DrawThemeTextEx(ThemeServices.Theme[teEdit], DC, Part, State,
PWideChar(Text), TextLen, TextFlags, @TextRect, Options);
end;
procedure DrawText(DC: HDC; const Text: WideString; TextLen: Integer;
var TextRect: TRect; TextFlags: Cardinal);
var
LForm: TCustomForm;
PaintOnGlass: Boolean;
Expand: Integer;
begin
PaintOnGlass := ThemeServices.ThemesEnabled and DwmCompositionEnabled and
not (csDesigning in ComponentState);
if PaintOnGlass then
begin
LForm := GetParentForm(Self);
PaintOnGlass := (LForm <> nil) and LForm.GlassFrame.FrameExtended and
LForm.GlassFrame.IntersectsControl(Self);
end;
if IsGlow and (Flags and DT_CALCRECT = 0) then
begin
Expand := GetExpansion(FGlowSize);
case Alignment of
taLeftJustify: OffsetRect(TextRect, Expand, 0);
taRightJustify: OffsetRect(TextRect, -Expand, 0);
end;
case Layout of
tlTop: OffsetRect(TextRect, 0, Expand);
tlBottom: OffsetRect(TextRect, 0, -Expand);
end;
end;
if PaintOnGlass and (Flags and DT_CALCRECT = 0) then
DoDrawThemeTextEx(DC, Text, TextLen, TextRect, TextFlags)
else
Windows.DrawTextW(DC, PWideChar(Text), TextLen, TextRect, TextFlags);
end;
const
EllipsisStr = '...';
Ellipsis: array[TEllipsisPosition] of Longint = (0, DT_PATH_ELLIPSIS,
DT_END_ELLIPSIS, DT_WORD_ELLIPSIS);
var
Text, DText: WideString;
NewRect: TRect;
Height, Delim: Integer;
begin
Text := Caption;
if (Flags and DT_CALCRECT <> 0) and ((Text = '') or ShowAccelChar and
(Text[1] = '&') and (Text[2] = #0)) then
Text := Text + ' ';
if not ShowAccelChar then
Flags := Flags or DT_NOPREFIX;
Flags := DrawTextBiDiModeFlags(Flags);
Canvas.Font := Font;
if (EllipsisPosition <> epNone) and not AutoSize then
begin
DText := Text;
Flags := Flags and not DT_EXPANDTABS;
Flags := Flags or Ellipsis[EllipsisPosition];
if WordWrap and (EllipsisPosition in [epEndEllipsis, epWordEllipsis]) then
begin
repeat
NewRect := Rect;
Dec(NewRect.Right, Canvas.TextWidth(EllipsisStr));
Windows.DrawTextW(Canvas.Handle, PWideChar(DText), Length(DText), NewRect, Flags or DT_CALCRECT);
Height := NewRect.Bottom - NewRect.Top;
if (Height > ClientHeight) and (Height > Canvas.Font.Height) then
begin
Delim := LastDelimiterW(' '#9, Text);
if Delim = 0 then
Delim := Length(Text);
Dec(Delim);
Text := Copy(Text, 1, Delim);
DText := Text + EllipsisStr;
if Text = '' then
Break;
end else
Break;
until False;
end;
if Text <> '' then
Text := DText;
end;
if not Enabled then
begin
OffsetRect(Rect, 1, 1);
Canvas.Font.Color := clBtnHighlight;
DrawText(Canvas.Handle, Text, Length(Text), Rect, Flags);
OffsetRect(Rect, -1, -1);
Canvas.Font.Color := clBtnShadow;
DrawText(Canvas.Handle, Text, Length(Text), Rect, Flags);
end
else
DrawText(Canvas.Handle, Text, Length(Text), Rect, Flags);
end;
function TCustomGlowLabel.GetExpansion(GlowSize: Integer): Integer;
begin
Result := Ceil(GlowSize / 2) + 1;
end;
function TCustomGlowLabel.IsGlow: Boolean;
begin
Result := FGlow and (FGlowSize > 0);
end;
procedure TCustomGlowLabel.SetGlow(const Value: Boolean);
begin
if FGlow <> Value then
begin
FGlow := Value;
AdjustBounds;
Invalidate;
end;
end;
procedure TCustomGlowLabel.SetGlowSize(const Value: Integer);
begin
if FGlowSize <> Value then
begin
FGlowSize := Value;
AdjustBounds;
Invalidate;
end;
end;
procedure Register;
begin
RegisterComponents('MWK', [TGlowLabel]);
end;
end.
-705
View File
@@ -1,705 +0,0 @@
unit VirtualList;
{$mode delphi}{$H+}
interface
uses
Forms, Controls, StdCtrls, Graphics, Classes, SysUtils, laz.VirtualTrees,
Logging, LMessages, LCLIntf, Math;
type
{$Z4} INPUTTYPE = (INPUT_MOUSE = $00, INPUT_KEYBOARD = $01, INPUT_HARDWARE = $02);
{$Z4} KEYEVENTF = (KEYEVENTF_EXTENDEDKEY = $01, KEYEVENTF_KEYUP = $02, KEYEVENTF_SCANCODE = $04, KEYEVENTF_UNICODE = $08);
{TKEYINPUT = record
itype: INPUTTYPE;
// tagKEYBDINPUT
wVk: WORD;
wScan: WORD;
dwFlags: KEYEVENTF;
time: DWORD;
dwExtraInfo: ULONG_PTR;
end;} //TODO
PVirtualItem = ^TVirtualItem;
TVirtualItem = record
NextItem: PVirtualItem;
Node: PVirtualNode;
Column: Word;
Selected: Boolean;
end;
{ TVirtualList }
TVirtualList = class(TLazVirtualDrawTree)
private
HintCanvas: TCanvas;
TileColumn: Word;
FirstItem: PVirtualItem;
LastItem: PVirtualItem;
LastSelected: PVirtualItem;
ClearAll: Boolean;
FSelectionCount: DWord;
FTilesCount: DWord;
function GetSelected(Item: PVirtualItem): Boolean;
procedure SetSelected(Item: PVirtualItem; Value: Boolean);
function GetFocusedNode(): PVirtualItem;
procedure SetFocusedNode(Item: PVirtualItem);
public
constructor Create(AOwner: TComponent); override;
procedure UpdateHintCanvas(newCanvas: TCanvas);
procedure DoGetHintSize(Node: PVirtualNode; Column: TColumnIndex; var R: TRect); override;
procedure UpdateTileColumn(count: Word; Forse: Boolean = False);
//function AddChild(Parent: PVirtualNode; UserData: Pointer = nil): PVirtualNode; override;
function AddChild(ParentItem: PVirtualNode; UserData: Pointer = nil): PVirtualNode; override;
function AddItem(ParentItem: PVirtualItem; UserData: Pointer = nil): PVirtualItem;
function GetFirst(ConsiderChildrenAbove: Boolean = False): PVirtualItem;
function GetNext(Item: PVirtualItem; ConsiderChildrenAbove: Boolean = False): PVirtualItem;
function GetLast(Node: PVirtualNode = nil; ConsiderChildrenAbove: Boolean = False): PVirtualItem;
function GetItemAt(Node: PVirtualNode; Column: TColumnIndex): PVirtualItem;
function GetNodeData(Item: PVirtualItem): Pointer;
procedure Clear; override;
function GetFirstSelected(ConsiderChildrenAbove: Boolean = False): PVirtualItem;
function GetNextSelected(Item: PVirtualItem; ConsiderChildrenAbove: Boolean = False): PVirtualItem;
property Selected[Item: PVirtualItem]: Boolean read GetSelected write SetSelected;
procedure ClearSelection;
procedure DeleteSelectedNodes; override;
property FocusedNode: PVirtualItem read GetFocusedNode write SetFocusedNode;
procedure DoPaintNode(var PaintInfo: TVTPaintInfo); override;
procedure PrepareCell(var PaintInfo: TVTPaintInfo; WindowOrgX, MaxWidth: Integer); override;
procedure DoPaintDropMark(Canvas: TCanvas; Node: PVirtualNode; const R: TRect); override;
procedure HandleMouseDblClick(var Message: TLMMouse; const HitInfo: THitInfo); override;
procedure HandleMouseDown(var Message: TLMMouse; var HitInfo: THitInfo); override;
procedure HandleMouseUp(Keys: PtrUInt; const HitInfo: THitInfo); override;
property SelectedCount: Dword read FSelectionCount;
property TilesCount: Dword read FTilesCount;
end;
//function SendInput(nInputs:UINT; pInputs:POINTER; cbSize:INTEGER):UINT; stdcall; external 'User32.dll' name 'SendInput';
Implementation
//----------------------------------------------------------------------------------------------------------------------
constructor TVirtualList.Create(AOwner: TComponent);
var
Pvdt: TLazVirtualDrawTree;
column: TVirtualTreeColumn;
c: Integer;
begin
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.Create START');
if not (AOwner is TLazVirtualDrawTree) then begin
Logger.Send([lcClient, lcDebug], 'TVirtualTree.Create(AOwner: TLazVirtualDrawTree) must get argument TLazVirtualDrawTree');
Assert(not (AOwner is TLazVirtualDrawTree), 'TVirtualTree.Create(AOwner: TLazVirtualDrawTree) must get argument TLazVirtualDrawTree');
Abort;
Halt;
end;
inherited Create(AOwner.Owner);
Pvdt := TLazVirtualDrawTree(AOwner);
Self.Parent := Pvdt.Parent;
FSelectionCount := 0;
FTilesCount:= 0;
TileColumn := 1;
ClearAll := True;
// Копирование свойств
Self.AnchorSideTop.Control := Pvdt.AnchorSideTop.Control;
Self.AnchorSideTop.Side := Pvdt.AnchorSideTop.Side;
Self.AnchorSideLeft.Control := Pvdt.AnchorSideLeft.Control;
Self.AnchorSideLeft.Side := Pvdt.AnchorSideLeft.Side;
Self.AnchorSideRight.Control := Pvdt.AnchorSideRight.Control;
Self.AnchorSideRight.Side := Pvdt.AnchorSideRight.Side;
Self.AnchorSideBottom.Control := Pvdt.AnchorSideBottom.Control;
Self.AnchorSideBottom.Side := Pvdt.AnchorSideBottom.Side;
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.Create 0');
Self.Left := Pvdt.Left;
Self.Height := Pvdt.Height;
Self.Hint := Pvdt.Hint;
Self.Top := Pvdt.Top;
Self.Width := Pvdt.Width;
Self.Anchors := Pvdt.Anchors;
Self.BorderSpacing.Top := Pvdt.BorderSpacing.Top;
Self.BorderSpacing.Left := Pvdt.BorderSpacing.Left;
Self.BorderSpacing.Right := Pvdt.BorderSpacing.Right;
Self.BorderSpacing.Bottom := Pvdt.BorderSpacing.Bottom;
Self.BiDiMode := Pvdt.BiDiMode;
Self.Tag := Pvdt.Tag;
Self.Color := Pvdt.Color;
Self.Colors.DropMarkColor := Pvdt.Colors.DropMarkColor;
Self.Colors.DropTargetColor := Pvdt.Colors.DropTargetColor;
Self.Colors.DropTargetBorderColor := Pvdt.Colors.DropTargetBorderColor;
Self.Colors.BorderColor := Pvdt.Colors.BorderColor;
Self.Colors.GridLineColor := Pvdt.Colors.GridLineColor;
Self.Colors.TreeLineColor := Pvdt.Colors.TreeLineColor;
Self.Colors.FocusedSelectionColor := Pvdt.Colors.FocusedSelectionColor;
Self.Colors.FocusedSelectionBorderColor := Pvdt.Colors.FocusedSelectionBorderColor;
Self.Colors.SelectionRectangleBlendColor := Pvdt.Colors.SelectionRectangleBlendColor;
Self.Colors.UnfocusedSelectionColor := Pvdt.Colors.UnfocusedSelectionColor;
Self.Colors.UnfocusedSelectionBorderColor := Pvdt.Colors.UnfocusedSelectionBorderColor;
Self.Constraints.MinHeight := Pvdt.Constraints.MinHeight;
Self.Constraints.MinWidth := Pvdt.Constraints.MinWidth;
Self.Constraints.MaxHeight := Pvdt.Constraints.MaxHeight;
Self.Constraints.MaxWidth := Pvdt.Constraints.MaxWidth;
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.Create 0___');
// Self.DefaultNodeHeight := Pvdt.DefaultNodeHeight;
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.Create 0&&&');
Self.DragKind := PVdt.DragKind;
Self.DragMode := Pvdt.DragMode;
Self.DragOperations := Pvdt.DragOperations;
Self.DragType := Pvdt.DragType;
Self.DrawSelectionMode := Pvdt.DrawSelectionMode;
Self.Font.Height := Pvdt.Font.Height;
Self.Font.Name := Pvdt.Font.Name;
Self.Font.Color := Pvdt.Font.Color;
Self.Font.Style := Pvdt.Font.Style;
Self.Font.Underline := Pvdt.Font.Underline;
Self.Font.Orientation := Pvdt.Font.Orientation;
Self.Font.Size := Pvdt.Font.Size;
Self.Font.Pitch := Pvdt.Font.Pitch;
Self.Font.Quality := Pvdt.Font.Quality;
Self.Header.AutoSizeIndex := Pvdt.Header.AutoSizeIndex;
Self.Header.DefaultHeight := Pvdt.Header.DefaultHeight;
Self.Header.MainColumn := Pvdt.Header.MainColumn;
Self.Header.Options := Pvdt.Header.Options;
Self.Header.ParentFont := Pvdt.Header.ParentFont;
Self.Header.Style := Pvdt.Header.Style;
Self.HintMode := Pvdt.HintMode;
Self.ParentFont := Pvdt.ParentFont;
Self.ParentShowHint := Pvdt.ParentShowHint;
Self.PopupMenu := Pvdt.PopupMenu;
Self.ScrollBarOptions.AlwaysVisible := Pvdt.ScrollBarOptions.AlwaysVisible;
Self.ScrollBarOptions.ScrollBars := Pvdt.ScrollBarOptions.ScrollBars;
Self.ShowHint := Pvdt.ShowHint;
Self.TabOrder := Pvdt.TabOrder;
Self.TreeOptions.AutoOptions := Pvdt.TreeOptions.AutoOptions;
Self.TreeOptions.MiscOptions := Pvdt.TreeOptions.MiscOptions;
Self.TreeOptions.PaintOptions := Pvdt.TreeOptions.PaintOptions;
Self.TreeOptions.SelectionOptions := Pvdt.TreeOptions.SelectionOptions;
// Копирование событий
Self.OnChange := Pvdt.OnChange;
Self.OnClick := Pvdt.OnClick;
Self.OnDrawHint := Pvdt.OnDrawHint;
Self.OnDrawNode := Pvdt.OnDrawNode;
Self.OnEnter := Pvdt.OnEnter;
Self.OnGetHintSize := Pvdt.OnGetHintSize;
Self.OnKeyDown := Pvdt.OnKeyDown;
Self.OnKeyPress := Pvdt.OnKeyPress;
Self.OnMouseDown := Pvdt.OnMouseDown;
Self.OnMouseMove := Pvdt.OnMouseMove;
Self.OnScroll := Pvdt.OnScroll;
Self.OnDragAllowed := Pvdt.OnDragAllowed;
Self.OnDragDrop := Pvdt.OnDragDrop;
Self.OnDragOver := Pvdt.OnDragOver;
// Копирование колонок
for c := 0 to Pvdt.Header.Columns.Count-1 do begin
column := Self.Header.Columns.Add;
column.Options := Pvdt.Header.Columns[c].Options;
column.Position := Pvdt.Header.Columns[c].Position;
column.MaxWidth := Pvdt.Header.Columns[c].MaxWidth;
column.MinWidth := Pvdt.Header.Columns[c].MinWidth;
column.Width := Pvdt.Header.Columns[c].Width;
column.Spacing := Pvdt.Header.Columns[c].Spacing;
column.Margin := Pvdt.Header.Columns[c].Margin;
column.Style := Pvdt.Header.Columns[c].Style;
column.Text := Pvdt.Header.Columns[c].Text;
end;
Pvdt.Destroy;
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.Create DONE');
end;
//----------------------------------------------------------------------------------------------------------------------
procedure TVirtualList.UpdateHintCanvas(newCanvas: TCanvas);
begin
// Для перерисовки тултипа нужна его канва, достать ее можно только при получении
// сообщения CM_HINTSHOW (см CMHintShow), но так как все нужные свойства закрыты
// единственным способом ее получения является обработчик события OnDrawHint
Self.HintCanvas := newCanvas;
end;
procedure TVirtualList.DoGetHintSize(Node: PVirtualNode; Column: TColumnIndex; var R: TRect);
begin
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.DoGetHintSize %d', [Column]);
inherited DoGetHintSize(Node, Column, R);
if (Self.HintCanvas <> nil) then begin
//Self.HintCanvas.Brush.Color := clRed;
Self.HintCanvas.Brush.Style := bsSolid;
Self.HintCanvas.FillRect(0,0,Self.HintCanvas.Width, Self.HintCanvas.Height);
inherited DoDrawHint(Self.HintCanvas, Node, R, Column);
end;
end;
//----------------------------------------------------------------------------------------------------------------------
procedure TVirtualList.UpdateTileColumn(count: Word; Forse: Boolean = False);
var
data, RawData, NodeDat: PByte;
n, c: DWord;
node: PVirtualNode;
item: PVirtualItem;
begin
if (not Forse and ((Self.TileColumn = count) or (Self.Header.Columns.Count <= count)))
then Exit;
getmem(RawData, NodeDataSize * RootNodeCount + NodeDataSize div Self.TileColumn * count);
data := RawData;
node := inherited GetFirst(False);
while node <> nil do begin
Move(inherited GetNodeData(node)^, data^, NodeDataSize);
inc(data, NodeDataSize);
node := inherited GetNext(node, False);
end;
SetRoundMode(rmUp);
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.UpdateTileColumn %d %d %d', [Self.RootNodeCount, Self.TileColumn, count]);
//nodes := Round(Self.RootNodeCount * Self.TileColumn / count);
SetRoundMode(rmNearest);
Self.ClearAll := False;
inherited Clear;
Self.NodeDataSize := Self.NodeDataSize div Self.TileColumn * count;
Self.ClearAll := True;
Self.TileColumn := count;
item := Self.FirstItem;
data := RawData;
//if (item <> nil) then
n:=0;
while item <> nil do begin
if (item^.NextItem = nil)
then Break;
node := inherited AddChild(nil);
NodeDat := inherited GetNodeData(node);
Move(data^, NodeDat^, Self.NodeDataSize);
inc(data, Self.NodeDataSize);
for c:=0 to Self.TileColumn - 1 do begin
if (item^.NextItem = nil)
then Break;
item^.Node := node;
item^.Column := c;
item := item^.NextItem;
end;
inc(n, +1);
end;
freemem(RawData);
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.UpdateTileColumn %s', ['Done']);
end;
function TVirtualList.AddChild(ParentItem: PVirtualNode; UserData: Pointer = nil): PVirtualNode;
begin
Result := PVirtualNode(Self.AddItem(PVirtualItem(Parent), UserData));
end;
function TVirtualList.AddItem(ParentItem: PVirtualItem; UserData: Pointer = nil): PVirtualItem;
var
item: PVirtualItem;
begin
// Logger.Send([lcClient, lcDebug], 'TVirtualTree.AddChild %s', ['Start']);
getmem(item, SizeOf(TVirtualItem));
item^.NextItem:=nil;
item^.Selected:=False;
if ((Self.LastItem = nil) or (Self.LastItem^.Column = Self.TileColumn - 1))
then begin
item^.Node := inherited AddChild(nil);
item^.Column := 0;
if (Self.FirstItem = nil)
then Self.FirstItem := item;
end else begin
item^.Node := Self.LastItem^.Node;
item^.Column := Self.LastItem^.Column + 1;
end;
if (Self.LastItem <> nil)
then Self.LastItem^.NextItem := item;
Self.LastItem := item;
Result := item;
inc(FTilesCount, +1);
// Logger.Send([lcClient, lcDebug], 'TVirtualTree.AddChild %s', ['Done']);
end;
function TVirtualList.GetFirst(ConsiderChildrenAbove: Boolean = False): PVirtualItem;
begin
Result := Self.FirstItem;
end;
function TVirtualList.GetNext(Item: PVirtualItem; ConsiderChildrenAbove: Boolean = False): PVirtualItem;
begin
Result := Item^.NextItem;
end;
function TVirtualList.GetLast(Node: PVirtualNode = nil; ConsiderChildrenAbove: Boolean = False): PVirtualItem;
begin
Result := Self.LastItem;
end;
function TVirtualList.GetItemAt(Node: PVirtualNode; Column: TColumnIndex): PVirtualItem;
begin
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.GetItemAt %s', ['Start']);
if (Column < 0) or (Column >= Self.Header.Columns.Count) then begin
Result := nil;
Exit;
end;
Result := Self.FirstItem;
while (Result <> nil) and ((Result^.Node <> Node) or (Result^.Column <> Word(Self.Header.Columns[Column].Tag)))
do Result := Result^.NextItem;
end;
function TVirtualList.GetNodeData(Item: PVirtualItem): Pointer;
begin
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.GetNodeData %s', ['Start']);
Result := inherited GetNodeData(Item^.Node) + (Item^.Column * NodeDataSize div Self.TileColumn);
end;
procedure TVirtualList.Clear;
var
item: PVirtualItem;
next: PVirtualItem;
begin
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.Clear %s', ['Called']);
// Злоябучий паскаль автоматически вызывает чистку при изменении NodeDataSize, что не всегда нужно...
if (Self.ClearAll) and (Self.FirstItem <> nil) then begin
next := Self.FirstItem;
while (next <> nil) do begin
item := next;
next := next^.NextItem;
freemem(item);
end;
Self.FirstItem:=nil;
Self.LastItem:=nil;
end;
inherited;
FTilesCount := 0;
FSelectionCount := 0;
end;
//----------------------------------------------------------------------------------------------------------------------
function TVirtualList.GetFirstSelected(ConsiderChildrenAbove: Boolean = False): PVirtualItem;
begin
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.GetFirstSelected %s', ['']);
Result := Self.FirstItem;
while ((Result <> nil) and (not Result^.Selected)) do begin
Result := Result^.NextItem;
end;
end;
function TVirtualList.GetNextSelected(Item: PVirtualItem; ConsiderChildrenAbove: Boolean = False): PVirtualItem;
begin
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.GetNextSelected %s', ['']);
Result := Item^.NextItem;
while ((Result <> nil) and (not Result^.Selected)) do begin
Result := Result^.NextItem;
end;
end;
function TVirtualList.GetSelected(Item: PVirtualItem): Boolean;
begin
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.GetSelected %s', ['']);
Result := Item^.Selected;
end;
procedure TVirtualList.SetSelected(Item: PVirtualItem; Value: Boolean);
begin
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.SetSelected %s', ['']);
if (Item^.Selected = Value)
then Exit;
Item^.Selected := Value;
if not Value
then Dec(FSelectionCount)
else begin
Inc(FSelectionCount);
Self.LastSelected := Item;
end;
// TODO: Обновить отображение выделения
end;
procedure TVirtualList.ClearSelection;
var
item: PVirtualItem;
begin
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.ClearSelection %s', ['']);
item := Self.FirstItem;
while (item <> nil) do begin
Self.SetSelected(item, False);
item := item^.NextItem;
end;
FSelectionCount := 0;
inherited ClearSelection;
end;
procedure TVirtualList.DeleteSelectedNodes;
var
item, next, prev: PVirtualItem;
node: PVirtualNode;
data, RawData: PByte;
size: Word;
c: Word;
begin
if (Self.GetFirstSelected() = nil)
then Exit;
size := NodeDataSize div Self.TileColumn;
getmem(RawData, NodeDataSize * RootNodeCount);
data := RawData;
prev := nil;
item := Self.FirstItem;
while (item <> nil) do begin
if (item^.Selected) then begin
next := item^.NextItem;
Dec(FTilesCount);
freemem(item);
if (prev <> nil) then begin
prev^.NextItem := next;
end else begin
Self.FirstItem := next;
end;
if (next = nil) then begin
Self.LastItem := prev;
end;
item := next;
end else begin
Move((inherited GetNodeData(item^.Node) + (size * item^.Column))^, data^, size);
inc(data, size);
prev := item;
item := item^.NextItem;
end;
end;
data := RawData;
item := Self.FirstItem;
node := inherited GetFirst();
while (node <> nil) do begin
Move(data^, inherited GetNodeData(node)^, NodeDataSize);
Inc(data, NodeDataSize);
for c := 0 to Self.TileColumn - 1 do
if item <> nil then begin
item^.Node := node;
item^.Column := c;
item := item^.NextItem;
end else Break;
if (item = nil)
then Break;
node := inherited GetNext(node);
end;
if (Self.LastItem = nil)
then inherited Clear
else begin
item := Self.LastItem^.NextItem;
while (item <> nil) do begin
if (item^.Node <> Self.LastItem^.Node) then begin
node := item^.Node;
while (node <> nil) do begin
inherited DeleteNode(node, False);
node := inherited GetNext(node);
end;
Break;
end;
item := item^.NextItem;
end;
end;
freemem(RawData);
Self.LastSelected := nil;
FSelectionCount := 0;
end;
//----------------------------------------------------------------------------------------------------------------------
function TVirtualList.GetFocusedNode(): PVirtualItem;
var
node: PVirtualNode;
begin
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.GetFocusedNode %s', ['']);
node := inherited FocusedNode;
Result := Self.FirstItem;
while ((Result <> nil) and (Result^.Node <> node))
do Result := Result^.NextItem;
end;
procedure TVirtualList.SetFocusedNode(Item: PVirtualItem);
begin
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.SetFocusedNode %s', ['']);
inherited FocusedNode := Item^.Node;
end;
//----------------------------------------------------------------------------------------------------------------------
procedure TVirtualList.DoPaintNode(var PaintInfo: TVTPaintInfo);
var
item: PVirtualItem;
node: PVirtualNode;
begin
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.DoPaintNode %s', ['Start']);
item := Self.FirstItem;//^.NextItem;
while ((item <> nil) and ((item^.Node^.Index <> PaintInfo.Node^.Index) or (item^.Column <> Word(Self.Header.Columns[PaintInfo.Column].Tag))))
do item := item^.NextItem;
if (item <> nil) then begin
node := PaintInfo.Node;
PaintInfo.Node := PVirtualNode(item);
inherited DoPaintNode(PaintInfo);
PaintInfo.Node := node;
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.DoPaintNode %s', ['Done']);
if (item^.Selected and (item = Self.LastSelected))
then PaintInfo.Canvas.Pen.Color := Colors.FocusedSelectionBorderColor
else if item^.Selected
then PaintInfo.Canvas.Pen.Color := Colors.UnfocusedSelectionBorderColor
else PaintInfo.Canvas.Pen.Color := Colors.BorderColor;
//PaintInfo.Canvas.Pen.Color := clRed;
PaintInfo.Canvas.Pen.Style := psDot;//psSolid;
PaintInfo.Canvas.Pen.Width := 1;
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.DoPaintNode [%d,%d,%d,%d] [%d,%d]', [PaintInfo.CellRect.Left, PaintInfo.CellRect.Top,
//PaintInfo.CellRect.Right - PaintInfo.CellRect.Left, PaintInfo.CellRect.Bottom - PaintInfo.CellRect.Top, PaintInfo.Canvas.Width, PaintInfo.Canvas.Height]);
PaintInfo.Canvas.Line(PaintInfo.CellRect.Left+1,PaintInfo.CellRect.Bottom-1,PaintInfo.CellRect.Right-1,PaintInfo.CellRect.Bottom-1);
PaintInfo.Canvas.Line(PaintInfo.CellRect.Right-1,PaintInfo.CellRect.Top+1,PaintInfo.CellRect.Left+1,PaintInfo.CellRect.Top+1);
if Self.TileColumn > 1 then begin
PaintInfo.Canvas.Line(PaintInfo.CellRect.Left+1,PaintInfo.CellRect.Top+1,PaintInfo.CellRect.Left+1,PaintInfo.CellRect.Bottom-1);
PaintInfo.Canvas.Line(PaintInfo.CellRect.Right-1,PaintInfo.CellRect.Bottom-1,PaintInfo.CellRect.Right-1,PaintInfo.CellRect.Top+1);
end;
PaintInfo.Canvas.Pen.Color := Color;
PaintInfo.Canvas.Pen.Style := psSolid;
PaintInfo.Canvas.Line(PaintInfo.CellRect.Left,PaintInfo.CellRect.Bottom,PaintInfo.CellRect.Right,PaintInfo.CellRect.Bottom);
PaintInfo.Canvas.Line(PaintInfo.CellRect.Right,PaintInfo.CellRect.Top,PaintInfo.CellRect.Left,PaintInfo.CellRect.Top);
if Self.TileColumn > 1 then begin
PaintInfo.Canvas.Line(PaintInfo.CellRect.Left,PaintInfo.CellRect.Top,PaintInfo.CellRect.Left,PaintInfo.CellRect.Bottom);
PaintInfo.Canvas.Line(PaintInfo.CellRect.Right,PaintInfo.CellRect.Bottom,PaintInfo.CellRect.Right,PaintInfo.CellRect.Top);
PaintInfo.Canvas.Pixels[PaintInfo.CellRect.Left+1,PaintInfo.CellRect.Top+1] := Color;
PaintInfo.Canvas.Pixels[PaintInfo.CellRect.Left+1,PaintInfo.CellRect.Bottom-1] := Color;
PaintInfo.Canvas.Pixels[PaintInfo.CellRect.Right-1,PaintInfo.CellRect.Bottom-1] := Color;
PaintInfo.Canvas.Pixels[PaintInfo.CellRect.Right-1,PaintInfo.CellRect.Top+1] := Color;
end;
//PaintInfo.Canvas.Rectangle(PaintInfo.CellRect);
//PaintInfo.Canvas.Line(Rect(1,1,PaintInfo.Canvas.Width-2, PaintInfo.Canvas.Height-2));
//PaintInfo.Canvas.Rectangle(Rect(1,1,PaintInfo.Canvas.Width-2, PaintInfo.Canvas.Height-2));
//PaintInfo.Canvas.Line(1,1,PaintInfo.Canvas.Width-2,PaintInfo.Canvas.Height-2);
//PaintInfo.Canvas.Line(1,1,1,PaintInfo.Canvas.Height-2);
//PaintInfo.Canvas.Line(1,PaintInfo.Canvas.Height-2,PaintInfo.Canvas.Width-2,PaintInfo.Canvas.Height-2);
//PaintInfo.Canvas.Line(PaintInfo.Canvas.Width-4,PaintInfo.Canvas.Height-2,PaintInfo.Canvas.Width-4,1);
//PaintInfo.Canvas.Line(0,PaintInfo.Canvas.Width,0,0);
end;
end;
procedure TVirtualList.PrepareCell(var PaintInfo: TVTPaintInfo; WindowOrgX, MaxWidth: Integer);
var
item: PVirtualItem;
begin
inherited PrepareCell(PaintInfo, WindowOrgX, MaxWidth);
item := Self.GetItemAt(PaintInfo.Node, PaintInfo.Column);
if (item = nil)
then Exit;
if (item^.Selected and (item = Self.LastSelected))
then PaintInfo.Canvas.Brush.Color := Colors.FocusedSelectionColor
else if item^.Selected
then PaintInfo.Canvas.Brush.Color := Colors.UnfocusedSelectionColor
else PaintInfo.Canvas.Brush.Color := Colors.GridLineColor;
PaintInfo.Canvas.Brush.Style := bsSolid;
PaintInfo.Canvas.FillRect(0,0,PaintInfo.Canvas.Width, PaintInfo.Canvas.Height);
end;
procedure TVirtualList.DoPaintDropMark(Canvas: TCanvas; Node: PVirtualNode; const R: TRect);
begin
end;
//----------------------------------------------------------------------------------------------------------------------
procedure TVirtualList.HandleMouseDblClick(var Message: TLMMouse; const HitInfo: THitInfo);
begin
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.HandleMouseDblClick %s', ['Start']);
inherited HandleMouseDblClick(Message, HitInfo);
end;
procedure TVirtualList.HandleMouseDown(var Message: TLMMouse; var HitInfo: THitInfo);
var
ShiftState: TShiftState;
HitItem: PVirtualItem;
item: PVirtualItem;
//kinput: TKEYINPUT;
begin
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.HandleMouseDown %s', ['Start']);
HitItem := Self.GetItemAt(HitInfo.HitNode, HitInfo.HitColumn);
if (HitItem = nil) then begin
inherited HandleMouseDown(Message, HitInfo);
Exit;
end;
ShiftState := KeysToShiftState(Message.Keys) * [ssShift, ssCtrl, ssAlt];
if not (ssAlt in ShiftState) then begin
if (not (ssCtrl in ShiftState)) and (not (ssShift in ShiftState)) then begin
if (not HitItem^.Selected)
then Self.ClearSelection;
Self.SetSelected(HitItem, True);
end else if not (ssShift in ShiftState) then begin
Self.SetSelected(HitItem, not HitItem^.Selected);
end else begin
if not (ssCtrl in ShiftState)
then Self.ClearSelection;
if Self.LastSelected = nil
then Self.LastSelected := Self.FirstItem;
if Self.LastSelected^.Node^.Index < HitItem^.Node^.Index then begin
item := Self.LastSelected;
HitItem := HitItem;
end else begin
item := HitItem;
HitItem := Self.LastSelected;
end;
while item <> HitItem^.NextItem do begin
Self.SetSelected(item, True);
item := item^.NextItem;
end;
end;
end;
// Вызываем перерисовку контрола (тутбы потом понормальному сделать...)
if (Self.Focused) then begin
Self.Parent.SetFocus;
Self.SetFocus;
end;
inherited HandleMouseDown(Message, HitInfo);
// Чтоже я творю-то...
{if (ShiftState = []) then begin
kinput.itype := INPUT_KEYBOARD;
kinput.wVk := $11; // VK_CONTROL
SendInput(1, @kinput, sizeof(TKEYINPUT));
BeginDrag(TRUE);
kinput.dwFlags := KEYEVENTF_KEYUP;
SendInput(1, @kinput, sizeof(TKEYINPUT));
end;} //TODO
end;
procedure TVirtualList.HandleMouseUp(Keys: PtrUInt; const HitInfo: THitInfo);
begin
//Logger.Send([lcClient, lcDebug], 'TVirtualTree.HandleMouseUp %s', ['Start']);
inherited HandleMouseUp(Keys, HitInfo);
end;
//----------------------------------------------------------------------------------------------------------------------
end.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

-40
View File
@@ -1,40 +0,0 @@
Sounds/MusicInf.wav
GLFont/DejaVu.png
GLFont/DejaVu.fnt
Overlay/LeftTopArrow.tga
Overlay/TopArrow.tga
Overlay/VirtualLayer.tga
Overlay/LightBulb_24nn.tga
Overlay/LightBulb_24bw.tga
Overlay/LightBulb_24tw.tga
Overlay/LightBulb_24bo.tga
Overlay/LightBulb_24to.tga
Overlay/LightBulb_24by.tga
Overlay/LightBulb_24ty.tga
Overlay/LightBulb_24ny.tga
Overlay/LightBulb_24bl.tga
Overlay/LightBulb_24bb.tga
Overlay/LightBulb_24tb.tga
Overlay/LightBulb_24bg.tga
Overlay/LightBulb_24tg.tga
Overlay/LightBulb_24br.tga
Overlay/LightBulb_24bp.tga
Overlay/Splash.bmp
Overlay/About.bmp
Cursors/BC_NormalSelect.cur
Cursors/BC_WorkingInBackground.cur
Cursors/BC_HelpSelect.cur
Cursors/BC_PrecisionSelect.cur
Cursors/BC_TextSelect.cur
Cursors/BI_Busy.ani
Cursors/TN_Unavailable.cur
Cursors/BC_Move.cur
Cursors/BC_DiagonalResize2.cur
Cursors/BC_VerticalResize.cur
Cursors/BC_DiagonalResize1.cur
Cursors/BC_HorizontalResize.cur
Cursors/BC_AlternateSelect.cur
Cursors/TN_LinkSelect.cur
Cursors/UO_Precision.cur
Cursors/UO_AttackMode.cur
Cursors/UO_Gauntlet.cur
Binary file not shown.
+252 -298
View File
@@ -1,313 +1,69 @@
inherited frmBoundaries: TfrmBoundaries
Left = 1259
Height = 141
Top = 502
Width = 403
Anchors = [akTop, akLeft, akBottom]
Caption = 'Границы видимости'
ClientHeight = 141
ClientWidth = 403
Left = 445
Height = 208
Top = 332
Width = 406
AutoSize = True
Caption = 'Boundaries'
ClientHeight = 208
ClientWidth = 406
OnCreate = FormCreate
object tbMaxZ: TTrackBar[0]
object gbZRestriction: TGroupBox[0]
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = tbMinZ
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 8
Height = 30
Top = 28
Width = 387
Frequency = 10
Max = 127
Min = -128
OnChange = tbMaxZChange
PageSize = 1
Position = 127
TickMarks = tmTopLeft
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8
BorderSpacing.Top = 20
BorderSpacing.Right = 8
TabOrder = 1
end
object GroupBox1: TGroupBox[1]
AnchorSideLeft.Control = tbMaxZ
AnchorSideTop.Control = tbMaxZ
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = tbMaxZ
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 216
Height = 72
Top = 60
Width = 179
Anchors = [akTop, akRight]
BorderSpacing.Top = 2
BorderSpacing.Bottom = 4
Caption = 'Границы высоты'
ClientHeight = 54
ClientWidth = 175
TabOrder = 2
object seMinZ: TSpinEdit
AnchorSideTop.Control = GroupBox1
AnchorSideRight.Control = GroupBox1
AnchorSideRight.Side = asrBottom
Left = 119
AnchorSideTop.Control = Owner
Left = 4
Height = 204
Top = 4
Width = 200
AutoSize = True
BorderSpacing.Left = 4
BorderSpacing.Top = 4
Caption = 'Restrict Height'
ClientHeight = 180
ClientWidth = 198
Constraints.MinWidth = 200
TabOrder = 0
object lblMinZ: TLabel
AnchorSideLeft.Control = tbMinZ
AnchorSideTop.Control = seMinZ
AnchorSideTop.Side = asrCenter
Left = 4
Height = 23
Top = 0
Width = 48
Top = 9
Width = 93
Caption = 'Minimum Z:'
Color = clDefault
Layout = tlCenter
ParentColor = False
Transparent = False
end
object seMinZ: TSpinEdit
AnchorSideTop.Control = gbZRestriction
AnchorSideRight.Control = gbZRestriction
AnchorSideRight.Side = asrBottom
Left = 132
Height = 33
Top = 4
Width = 62
Anchors = [akTop, akRight]
BorderSpacing.Right = 8
BorderSpacing.Top = 4
BorderSpacing.Right = 4
MaxValue = 127
MinValue = -128
OnChange = seMinZChange
TabOrder = 0
Value = -128
end
object seMaxZ: TSpinEdit
object tbMinZ: TTrackBar
AnchorSideLeft.Control = gbZRestriction
AnchorSideTop.Control = seMinZ
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = GroupBox1
AnchorSideRight.Control = gbZRestriction
AnchorSideRight.Side = asrBottom
Left = 119
Height = 23
Top = 28
Width = 48
Anchors = [akTop, akRight]
BorderSpacing.Top = 5
BorderSpacing.Right = 8
MaxValue = 127
MinValue = -128
OnChange = seMaxZChange
TabOrder = 1
Value = 127
end
object lblMinZ: TLabel
AnchorSideLeft.Control = GroupBox1
AnchorSideTop.Control = seMinZ
AnchorSideTop.Side = asrCenter
Left = 8
Height = 16
Top = 3
Width = 93
BorderSpacing.Left = 8
BorderSpacing.Top = 6
Caption = 'Z Минимальная:'
Layout = tlCenter
ParentColor = False
end
object lblMaxZ: TLabel
AnchorSideLeft.Control = lblMinZ
AnchorSideTop.Control = seMaxZ
AnchorSideTop.Side = asrCenter
Left = 8
Height = 16
Top = 31
Width = 97
Caption = 'Z Максимальная:'
Layout = tlCenter
ParentColor = False
end
end
object GroupBox2: TGroupBox[2]
AnchorSideLeft.Control = tbMaxZ
AnchorSideTop.Control = GroupBox1
AnchorSideRight.Control = GroupBox1
AnchorSideBottom.Control = GroupBox1
AnchorSideBottom.Side = asrBottom
Left = 8
Height = 72
Top = 60
Width = 201
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Right = 7
Caption = 'Границы дальности обзора'
ClientHeight = 54
ClientWidth = 197
TabOrder = 3
object seMaxX: TSpinEdit
AnchorSideTop.Control = GroupBox2
AnchorSideRight.Control = GroupBox2
AnchorSideRight.Side = asrBottom
Left = 137
Height = 23
Top = 0
Width = 54
Anchors = [akTop, akRight]
BorderSpacing.Right = 6
MaxValue = 12288
OnChange = seMaxXChange
TabOrder = 0
Value = 12288
end
object seMaxY: TSpinEdit
AnchorSideTop.Control = seMaxX
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = GroupBox2
AnchorSideRight.Side = asrBottom
Left = 137
Height = 23
Top = 28
Width = 54
Anchors = [akTop, akRight]
BorderSpacing.Top = 5
BorderSpacing.Right = 6
MaxValue = 8192
OnChange = seMaxYChange
TabOrder = 1
Value = 8192
end
object seMinY: TSpinEdit
AnchorSideTop.Control = seMaxY
AnchorSideRight.Control = seMaxY
Left = 64
Height = 23
Top = 28
Width = 54
Anchors = [akTop, akRight]
BorderSpacing.Right = 19
MaxValue = 8192
OnChange = seMinYChange
TabOrder = 2
end
object seMinX: TSpinEdit
AnchorSideTop.Control = seMaxX
AnchorSideRight.Control = seMaxX
Left = 64
Height = 23
Top = 0
Width = 54
Anchors = [akTop, akRight]
BorderSpacing.Right = 19
MaxValue = 12288
OnChange = seMinXChange
TabOrder = 3
end
object lblAxeX: TLabel
AnchorSideLeft.Control = sbClearXbnd
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = seMinZ
AnchorSideTop.Side = asrCenter
Left = 23
Height = 16
Top = 3
Width = 35
BorderSpacing.Left = 3
BorderSpacing.Top = 6
Caption = 'Ось X:'
Layout = tlCenter
ParentColor = False
end
object lblAxeY: TLabel
AnchorSideLeft.Control = sbClearYbnd
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = seMinZ
AnchorSideTop.Side = asrCenter
Left = 23
Height = 16
Top = 31
Width = 35
BorderSpacing.Left = 3
BorderSpacing.Top = 6
Caption = 'Ось Y:'
Layout = tlCenter
ParentColor = False
end
object lblAxeX1: TLabel
AnchorSideLeft.Control = seMinX
AnchorSideTop.Control = seMaxX
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = seMaxX
AnchorSideRight.Side = asrBottom
Left = 112
Height = 16
Top = 3
Width = 31
Alignment = taCenter
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 48
BorderSpacing.Top = 6
BorderSpacing.Right = 48
Caption = '—'
Layout = tlCenter
ParentColor = False
end
object lblAxeY1: TLabel
AnchorSideLeft.Control = seMinY
AnchorSideTop.Control = seMaxY
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = seMaxY
AnchorSideRight.Side = asrBottom
Left = 112
Height = 16
Top = 31
Width = 31
Alignment = taCenter
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 48
BorderSpacing.Top = 6
BorderSpacing.Right = 48
Caption = '—'
Layout = tlCenter
ParentColor = False
end
object sbClearXbnd: TSpeedButton
AnchorSideLeft.Control = GroupBox2
AnchorSideTop.Control = seMaxX
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = lblAxeX
Left = 4
Height = 16
Top = 3
Width = 16
BorderSpacing.Left = 4
BorderSpacing.Right = 2
Caption = '✇'
Font.CharSet = RUSSIAN_CHARSET
Font.Height = -8
Font.Name = 'Tahoma'
Font.Pitch = fpVariable
Font.Quality = fqDraft
NumGlyphs = 0
OnClick = sbClearXbndClick
ShowHint = True
ParentFont = False
ParentShowHint = False
end
object sbClearYbnd: TSpeedButton
AnchorSideLeft.Control = GroupBox2
AnchorSideTop.Control = seMaxY
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = lblAxeX
Left = 4
Height = 16
Top = 31
Width = 16
BorderSpacing.Left = 4
BorderSpacing.Right = 2
Caption = '✇'
Font.CharSet = RUSSIAN_CHARSET
Font.Height = -8
Font.Name = 'Tahoma'
Font.Pitch = fpVariable
Font.Quality = fqDraft
NumGlyphs = 0
OnClick = sbClearYbndClick
ShowHint = True
ParentFont = False
ParentShowHint = False
end
end
object tbMinZ: TTrackBar[3]
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 8
Height = 30
Top = 8
Width = 387
Height = 47
Top = 41
Width = 190
Frequency = 10
Max = 127
Min = -128
@@ -315,10 +71,208 @@ inherited frmBoundaries: TfrmBoundaries
PageSize = 1
Position = -128
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 8
BorderSpacing.Around = 4
TabOrder = 1
end
object lblMaxZ: TLabel
AnchorSideLeft.Control = tbMaxZ
AnchorSideTop.Control = seMaxZ
AnchorSideTop.Side = asrCenter
Left = 4
Height = 23
Top = 97
Width = 97
Caption = 'Maximum Z:'
Color = clDefault
Layout = tlCenter
ParentColor = False
Transparent = False
end
object seMaxZ: TSpinEdit
AnchorSideTop.Control = tbMinZ
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = seMinZ
AnchorSideRight.Side = asrBottom
Left = 132
Height = 33
Top = 92
Width = 62
Anchors = [akTop, akRight]
MaxValue = 127
MinValue = -128
OnChange = seMaxZChange
TabOrder = 2
Value = 127
end
object tbMaxZ: TTrackBar
AnchorSideLeft.Control = gbZRestriction
AnchorSideTop.Control = seMaxZ
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = gbZRestriction
AnchorSideRight.Side = asrBottom
Left = 4
Height = 47
Top = 129
Width = 190
Frequency = 10
Max = 127
Min = -128
OnChange = tbMaxZChange
PageSize = 1
Position = 127
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 4
TabOrder = 3
end
end
object gbViewRestriction: TGroupBox[1]
AnchorSideLeft.Control = gbZRestriction
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = gbZRestriction
AnchorSideBottom.Side = asrBottom
Left = 208
Height = 200
Top = 4
Width = 194
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 4
Caption = 'Restrict View Range'
ClientHeight = 176
ClientWidth = 192
TabOrder = 1
object seMinX: TSpinEdit
AnchorSideLeft.Control = lblX
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = seMaxX
Left = 22
Height = 33
Top = 4
Width = 74
BorderSpacing.Left = 4
OnChange = seMinXChange
TabOrder = 0
end
inherited tmClose: TTimer[4]
left = 312
object seMaxX: TSpinEdit
AnchorSideTop.Control = gbViewRestriction
AnchorSideRight.Control = gbViewRestriction
AnchorSideRight.Side = asrBottom
Left = 114
Height = 33
Top = 4
Width = 74
Anchors = [akTop, akRight]
BorderSpacing.Top = 4
BorderSpacing.Right = 4
OnChange = seMaxXChange
TabOrder = 1
end
object seMinY: TSpinEdit
AnchorSideLeft.Control = seMinX
AnchorSideTop.Control = seMinX
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = seMinX
AnchorSideRight.Side = asrBottom
Left = 22
Height = 33
Top = 45
Width = 74
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 8
OnChange = seMinYChange
TabOrder = 2
end
object seMaxY: TSpinEdit
AnchorSideLeft.Control = seMaxX
AnchorSideTop.Control = seMinY
AnchorSideRight.Control = seMaxX
AnchorSideRight.Side = asrBottom
Left = 114
Height = 33
Top = 45
Width = 74
Anchors = [akTop, akLeft, akRight]
OnChange = seMaxYChange
TabOrder = 3
end
object lblX: TLabel
AnchorSideLeft.Control = gbViewRestriction
AnchorSideTop.Control = seMinX
AnchorSideTop.Side = asrCenter
Left = 4
Height = 23
Top = 9
Width = 14
BorderSpacing.Left = 4
Caption = 'X:'
Color = clDefault
ParentColor = False
Transparent = False
end
object lblY: TLabel
AnchorSideLeft.Control = lblX
AnchorSideTop.Control = seMinY
AnchorSideTop.Side = asrCenter
Left = 4
Height = 23
Top = 50
Width = 13
Caption = 'Y:'
Color = clDefault
ParentColor = False
Transparent = False
end
object lblXSep: TLabel
AnchorSideLeft.Control = seMinX
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = seMaxX
AnchorSideTop.Side = asrCenter
Left = 100
Height = 23
Top = 9
Width = 17
BorderSpacing.Left = 4
Caption = '—'
Color = clDefault
ParentColor = False
Transparent = False
end
object lblYSep: TLabel
AnchorSideLeft.Control = lblXSep
AnchorSideTop.Control = seMinY
AnchorSideTop.Side = asrCenter
Left = 100
Height = 23
Top = 50
Width = 17
Caption = '—'
Color = clDefault
ParentColor = False
Transparent = False
end
object btnSelectArea: TButton
Left = 0
Height = 25
Top = 95
Width = 112
Caption = 'Select Area'
OnClick = btnSelectAreaClick
TabOrder = 4
end
object btnClear: TButton
Left = 117
Height = 25
Top = 95
Width = 75
Caption = 'Clear'
OnClick = btnClearClick
TabOrder = 5
end
end
inherited tmClose: TTimer[2]
Left = 200
Top = 176
end
end
+61 -75
View File
@@ -21,7 +21,8 @@
* CDDL HEADER END
*
*
* Portions Copyright 2009 Andreas Schneider
* Portions Copyright 2015 Andreas Schneider
* Portions Copyright 2015 StaticZ
*)
unit UfrmBoundaries;
@@ -31,34 +32,34 @@ interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
ComCtrls, Spin, ExtCtrls, Buttons, UfrmToolWindow;
ComCtrls, Spin, ExtCtrls, UfrmToolWindow, USelectionHelper;
type
{ TfrmBoundaries }
TfrmBoundaries = class(TfrmToolWindow)
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
lblAxeX1: TLabel;
lblAxeY1: TLabel;
btnSelectArea: TButton;
btnClear: TButton;
gbZRestriction: TGroupBox;
gbViewRestriction: TGroupBox;
lblYSep: TLabel;
lblXSep: TLabel;
lblY: TLabel;
lblX: TLabel;
lblMaxZ: TLabel;
lblMinZ: TLabel;
lblAxeX: TLabel;
lblAxeY: TLabel;
seMaxZ: TSpinEdit;
seMinZ: TSpinEdit;
seMaxX: TSpinEdit;
seMaxY: TSpinEdit;
seMinY: TSpinEdit;
seMinX: TSpinEdit;
sbClearXbnd: TSpeedButton;
sbClearYbnd: TSpeedButton;
tbMinZ: TTrackBar;
seMaxX: TSpinEdit;
seMinY: TSpinEdit;
seMaxY: TSpinEdit;
tbMaxZ: TTrackBar;
tbMinZ: TTrackBar;
procedure btnSelectAreaClick(Sender: TObject);
procedure btnClearClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure sbClearXbndClick(Sender: TObject);
procedure sbClearYbndClick(Sender: TObject);
procedure seMaxXChange(Sender: TObject);
procedure seMaxYChange(Sender: TObject);
procedure seMaxZChange(Sender: TObject);
@@ -67,6 +68,8 @@ type
procedure seMinZChange(Sender: TObject);
procedure tbMaxZChange(Sender: TObject);
procedure tbMinZChange(Sender: TObject);
protected
procedure RangeSelected(AX1, AY1, AX2, AY2: Word);
public
{ public declarations }
end;
@@ -77,105 +80,88 @@ var
implementation
uses
UfrmMain, Language;
UfrmMain;
{ TfrmBoundaries }
procedure TfrmBoundaries.FormCreate(Sender: TObject);
begin
LanguageTranslate(Self);
seMaxX.MaxValue := 8*frmMain.Landscape.Width-1;
seMinX.MaxValue := seMaxX.MaxValue; seMaxX.Value := seMaxX.MaxValue;
seMaxY.MaxValue := 8*frmMain.Landscape.Height-1;
seMinY.MaxValue := seMaxY.MaxValue; seMaxY.Value := seMaxY.MaxValue;
end;
procedure TfrmBoundaries.sbClearXbndClick(Sender: TObject);
begin
seMinX.Value := seMinX.MinValue;
seMinX.MaxValue := frmMain.Landscape.CellWidth - 1;
seMaxX.MaxValue := seMinX.MaxValue;
seMaxX.Value := seMaxX.MaxValue;
frmMain.InvalidateFilter;
seMinY.MaxValue := frmMain.Landscape.CellHeight - 1;
seMaxY.MaxValue := seMinY.MaxValue;
seMaxY.Value := seMaxX.MaxValue;
end;
procedure TfrmBoundaries.sbClearYbndClick(Sender: TObject);
procedure TfrmBoundaries.btnSelectAreaClick(Sender: TObject);
begin
seMinY.Value := seMinY.MinValue;
SelectRange(@RangeSelected);
end;
procedure TfrmBoundaries.btnClearClick(Sender: TObject);
begin
seMinX.Value := 0;
seMinY.Value := 0;
seMaxX.Value := seMaxX.MaxValue;
seMaxY.Value := seMaxY.MaxValue;
frmMain.InvalidateFilter;
end;
procedure TfrmBoundaries.seMinXChange(Sender: TObject);
begin
if (seMaxX.Value <= seMinX.Value) then if (seMinX.Value < seMaxX.MaxValue)
then seMaxX.Value := seMinX.Value+1
else seMaxX.Value := seMaxX.MaxValue;
frmMain.InvalidateFilter;
end;
procedure TfrmBoundaries.seMaxXChange(Sender: TObject);
begin
if (seMinX.Value >= seMaxX.Value) then if (seMaxX.Value > seMinX.MinValue)
then seMinX.Value := seMaxX.Value-1
else seMinX.Value := seMinX.MinValue;
frmMain.InvalidateFilter;
end;
procedure TfrmBoundaries.seMinYChange(Sender: TObject);
begin
if (seMaxY.Value <= seMinY.Value) then if (seMinY.Value < seMaxY.MaxValue)
then seMaxY.Value := seMinY.Value+1
else seMaxY.Value := seMaxY.MaxValue;
frmMain.InvalidateFilter;
end;
procedure TfrmBoundaries.seMaxYChange(Sender: TObject);
begin
if (seMinY.Value >= seMaxY.Value) then if (seMaxY.Value > seMinY.MinValue)
then seMinY.Value := seMaxY.Value-1
else seMinY.Value := seMinY.MinValue;
frmMain.InvalidateFilter;
end;
procedure TfrmBoundaries.seMinZChange(Sender: TObject);
begin
if (seMaxZ.Value <= seMinZ.Value) then if (seMinZ.Value < seMaxZ.MaxValue)
then seMaxZ.Value := seMinZ.Value+1
else seMaxZ.Value := seMaxZ.MaxValue;
tbMinZ.Position := seMinZ.Value;
tbMaxZ.Position := seMaxZ.Value;
frmMain.InvalidateFilter;
end;
procedure TfrmBoundaries.seMaxZChange(Sender: TObject);
begin
if (seMinZ.Value >= seMaxZ.Value) then if (seMaxZ.Value > seMinZ.MinValue)
then seMinZ.Value := seMaxZ.Value-1
else seMinZ.Value := seMinZ.MinValue;
tbMaxZ.Position := seMaxZ.Value;
tbMinZ.Position := seMinZ.Value;
frmMain.InvalidateFilter;
end;
procedure TfrmBoundaries.tbMinZChange(Sender: TObject);
procedure TfrmBoundaries.seMinXChange(Sender: TObject);
begin
if (tbMaxZ.Position <= tbMinZ.Position) then if (tbMinZ.Position < tbMaxZ.Max)
then tbMaxZ.Position := tbMinZ.Position+1
else tbMaxZ.Position := tbMaxZ.Max;
seMinZ.Value := tbMinZ.Position;
seMaxZ.Value := tbMaxZ.Position;
frmMain.InvalidateFilter;
end;
procedure TfrmBoundaries.seMinYChange(Sender: TObject);
begin
frmMain.InvalidateFilter;
end;
procedure TfrmBoundaries.seMinZChange(Sender: TObject);
begin
tbMinZ.Position := seMinZ.Value;
frmMain.InvalidateFilter;
end;
procedure TfrmBoundaries.tbMaxZChange(Sender: TObject);
begin
if (tbMinZ.Position >= tbMaxZ.Position) then if (tbMaxZ.Position > tbMinZ.Min)
then tbMinZ.Position := tbMaxZ.Position-1
else tbMinZ.Position := tbMinZ.Min;
seMaxZ.Value := tbMaxZ.Position;
frmMain.InvalidateFilter;
end;
procedure TfrmBoundaries.tbMinZChange(Sender: TObject);
begin
seMinZ.Value := tbMinZ.Position;
frmMain.InvalidateFilter;
end;
procedure TfrmBoundaries.RangeSelected(AX1, AY1, AX2, AY2: Word);
begin
seMinX.Value := AX1;
seMinY.Value := AY1;
seMaxX.Value := AX2;
seMaxY.Value := AY2;
frmBoundaries.Show;
end;
initialization
{$I UfrmBoundaries.lrs}

Some files were not shown because too many files have changed in this diff Show More