The Problem:
When my shape is dropped on a page, the first time I change the shape's data from previousOption to newOption, it seems to fire two events:
1) Event 1 with previousOption
2) Event 2 with newOption
Desired fix:
Shape data changes fires only one Event with newOption
The setup: Shapesheet
*Shape Data: list of options
*User-Defined Cells: DEPENDSON(Prop.data) + CALLTHIS( "CodeModule.FooFunction", "CodeFile", Option )
The QA:
Debug.print in Foo shows
*On first shape data change:
-Foo( Previous Option )
-Foo( New Option )
*On subsequent changes:
-Foo( new Option)
If you drop the new shape: Does this automatically trigger the ShapeDataDialog? Than you make the first change, hit OK, and your function get's triggered two times?
The question is why Visio thinks Prop.data is changed, when a shape is only dropped on the page. The value should be the original value in the mastershape, or not?
Maybe add a user cell User.FirstTrigger with value false. OnDrop-Event set the value to true. In code look if value true or false and react accordingly. Problem with that can be order in which Visio handles events.
Quote from: Jumpy on November 26, 2012, 07:59:06 AM
If you drop the new shape: Does this automatically trigger the ShapeDataDialog?
No, I don't force user to use a dialog box.
However it does fire events multiple times, not even just 2, but 4 or so times on the shape being dropped.
Furthermore, it fires incomplete calls. I traced the functions that are being called and they are either being partially called or the debug messages are not going to the immediate window
Quote from: Jumpy on November 26, 2012, 07:59:06 AM
Than you make the first change, hit OK, and your function get's triggered two times?
Yes
Quote from: Jumpy on November 26, 2012, 07:59:06 AM
The question is why Visio thinks Prop.data is changed, when a shape is only dropped on the page. The value should be the original value in the mastershape, or not?
Yes I would of thought there should be no events being fired if there is no data change and there lies my problem.
Quote from: Jumpy on November 26, 2012, 07:59:06 AM
Maybe add a user cell User.FirstTrigger with value false. OnDrop-Event set the value to true. In code look if value true or false and react accordingly. Problem with that can be order in which Visio handles events.
Great idea! I will try that. This could also be a situation where I offload the code handling to formulas too.
Thanks again for your help, I look forward to when I can return it.
Browser ID: smf
(is_webkit)
Templates: 1:
Printpage (default).
Sub templates: 4:
init,
print_above,
main,
print_below.
Language files: 1:
index+Modifications.english (default).
Style sheets: 0:
.
Hooks called: 46 (
showintegrate_autoload, cache_get_data, integrate_pre_load, integrate_load_session, integrate_verify_user, cache_get_data, integrate_user_info, integrate_load_board, cache_get_data, integrate_board_info, cache_get_data, integrate_allowed_to_general, integrate_pre_load_theme, cache_get_data, integrate_allowed_to_general, integrate_simple_actions, integrate_allowed_to_general, integrate_load_theme, integrate_pre_log_stats, integrate_actions, integrate_pre_parsebbc, integrate_bbc_codes, integrate_bbc_print, integrate_post_parsebbc, integrate_pre_parsebbc, integrate_bbc_print, integrate_post_parsebbc, integrate_pre_parsebbc, integrate_bbc_print, integrate_post_parsebbc, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general, integrate_menu_buttons, integrate_current_action, integrate_theme_context, integrate_allowed_to_general, integrate_allowed_to_general, integrate_allowed_to_general)
Files included: 25 - 925KB. (
show/home/iw0lkfe3x6cq/public_html/vgforum/index.php, /home/iw0lkfe3x6cq/public_html/vgforum/Settings.php, /home/iw0lkfe3x6cq/public_html/vgforum/cache/db_last_error.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/QueryString.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Subs.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Subs-Auth.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Errors.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Load.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Security.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Subs-Compat.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Subs-Db-mysql.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Cache/CacheApi.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Cache/CacheApiInterface.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Cache/APIs/FileBased.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Subs-Charset.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Unicode/Metadata.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Unicode/QuickCheck.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Session.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Logging.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Class-BrowserDetect.php, (Current Theme)/languages/index.english.php, (Current Theme)/languages/Modifications.english.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Printpage.php, (Current Theme)/Printpage.template.php, /home/iw0lkfe3x6cq/public_html/vgforum/Sources/Unicode/CaseUpper.php)
Memory used: 773KB.
Tokens:
post-login.
Cache hits: 6: 0.00082s for 22,291 bytes (
showget modSettings: 0.00039s - 19982 bytes, get known_languages: 0.00014s - 1277 bytes, get board_parents-0: 0.00010s - 2 bytes, get permissions:-1: 0.00007s - 50 bytes, get theme_settings-1: 0.00009s - 980 bytes, get menu_buttons--1-english: 0.00002s - 0 bytes)
Cache misses: 1: (
showget menu_buttons--1-english)
Queries used: 8.
[Show Queries]