components

Game framework architecture - view components or MVC?

我与影子孤独终老i 提交于 2019-12-04 11:11:50
问题 I'm trying to build a very light re-usable framework for my games, rather than starting from scratch each time I start a game. I have a component driven architecture - e.g. Entity composes a Position component and a Health component and Ai component etc. My big question is whether my model composes view components to allow for more than one view of the model, or whether to use a truer MVC where the model does not know about its views, and they are managed externally. I have tried both methods

Need a ComboBox with filtering

耗尽温柔 提交于 2019-12-04 10:42:42
I need some type of ComboBox which can load it's items from DB. While I type some text in to it, it should filter it's list, leaving only those items, that have my text somewhere (at the beginning, middle...). Not all my DataSet's have filtering capabilities, so it is not possible to use them. Is there any ready to use components with such abilities? I have tried to search in JVCL, but without luck. You could try customizing the autocomplete functionality of a regular ComboBox. Loading its items from a DB is easy: ComboBox1.Items.Clear; while not Table1.Eof do begin ComboBox1.Items.AddObject(

Angular 4 - get input value

删除回忆录丶 提交于 2019-12-04 09:55:42
问题 I would like to know how to get the value from an input on angular 4. I looked over the documentation on angular and the example with the key event doesn't work very well for me and I can't find a proper example how to do this so please help me out The problem: I try to read the input's value and after submiting the value to another component that will add the value to a select tag(e.g. send the name of the person to a list for a select tag) 回答1: <form (submit)="onSubmit()"> <input [(ngModel)

Extjs component inside Ext.XTemplate on EXTJS 4

冷暖自知 提交于 2019-12-04 08:47:55
问题 I'm trying to add extjs components to tpl panel. Is there anyway to insert component to tpl like this Ext.create('Ext.panel.Panel',{ renderTo: Ext.getBody(), data: {}, listeners:{ afterrender:function(){ var renderSelector = Ext.query('div.comment-add-textarea'); for(var i in renderSelector){ Ext.create('Ext.form.field.TextArea',{ height:300, renderTo:renderSelector[i] }); } } }, tpl: Ext.create('Ext.XTemplate', '<tpl for=".">', '<div class="comment-add-textarea"></div>', '</tpl>',{ compiled

Dynamically load component in div - Angular5

纵然是瞬间 提交于 2019-12-04 08:34:46
I was able to successfully create a button that on click loads another instance of my component into the DOM, but it loads it outside the component I want it to be inside which results with the CSS being off. When I add "editorComponents" to my page it currently looks like this: But I want it to look like this: You can see from the inspection that in the second example all of the tags are manually moved to where I want them to be. Right now my code is as follows: home.component.html <div class="row backgroundContainer"> <div class="col-md-7 componentContainer"> <app-editor></app-editor>

Angular 2 - Styling Component's selector border css property

旧城冷巷雨未停 提交于 2019-12-04 08:19:13
Update: In my comment bellow you can find a zipped project on Google drive. Can anyone make a Plunker (I have never done it - what needs to be changed, any article/blog explaining this change). I have a SearchComponent which extends BaseComponent and I am passing ElementRef down to BaseComponent so that BaseComponent can add a border style to SearchComponent 's selector tag: auction-search . Basically I want to draw a border for all components (that extend BaseComponent ) on a page, so I can easily identify them. However it seems that the width of auction-search tag is auto (I don't know if

Tag editor component for Delphi/C++Builder

妖精的绣舞 提交于 2019-12-04 07:48:37
问题 I need a VCL tag editor component for Delphi or C++Builder, similar to what's available for JavaScript: e.g. this one, or this one or StackOverflow's own tags editor. Is there something like this available or do I need to make it from scratch? Some specific things that I need are: Editor should allow either scrolling or become multi-line if more tags are present than the editor's width allows. If multi-line, there should be an option to define some maximum height however, preventing it from

Angular 2 share websocket service across components

社会主义新天地 提交于 2019-12-04 07:21:12
I am building a web application using angular 2 in which I want to have multiple components listening to the same service. This service returns an observable that returns incoming data from a websocket. I wrote the code based on this example. The current problem is: The data is send from the home component through the service to the server (using websockets) and data is returned. However, only the observer in the home.component is getting called (with id: room.created and data), not the one in the navbar. Could someone tell me why not both are called? I also tried to add the messages$

How to use DefineProperties in a custom Class Object for Arrays - Delphi

…衆ロ難τιáo~ 提交于 2019-12-04 06:26:30
问题 I'm trying to create my own class object and use it to store various data types for my application, this all works fine when using Published Properties, I can stream these to disk and back with no problems. But I need to stream some Arrays of both integer and strings data types as well. I understand that Arrays, amongst other data types can't be published properties because Delphi doesn't know how to stream them, I was led to believe you need to use DefineProperties to accomplish this, I've

Cast jzy3d.canvas to awt.component

ε祈祈猫儿з 提交于 2019-12-04 06:15:04
问题 I need cast the jzy3d canvas to java.awt.component, I want to display the chart in my frame with JCombobox and button but when I want to cast canvas to component, the program was dropped. Thank you for your answers. I have try this and don't help me. Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: org.jzy3d.plot3d.rendering.canvas.VoidCanvas cannot be cast to java.awt.Component at cz.bia.Launcher.lambda$setComponents$0(Launcher.java:63) at java.awt.Button