DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: laohutou
今日帖子: 7
在线用户: 12
导航: 论坛 -> 移动应用开发 斑竹:flyers,iamdream  
作者:
男 mp654kk (mp654kk) ▲△△△△ -
普通会员
2023/9/3 18:20:15
标题:
新手请问安卓环境combobox为什么调整不了高度 浏览:1341
加入我的收藏
楼主:  ComboBox1.height:=20;
windows下可以安卓下无效,(没有使用stylelookup),设计器里改变大小也不行,请问为什么?
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/9/3 21:04:42
1楼: You have to realize that everything that uses a new style must respect a new way of being.  So when you use a style you will be overriding an old style, so you must change the properties in the new style.

  You can do this by accessing the element responsible for the new presentation of the object by accessing the StyleBook and changing the definitions of the desired property.  It is also possible to do this in code, but it is more laborious and requires knowing the property used internally in the style.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 mp654kk (mp654kk) ▲△△△△ -
普通会员
2023/9/4 0:08:23
2楼: @emailx45 但是在样式设计器里修改了高度为60
此帖子包含附件:
JPEG 图像
大小:129.3K
----------------------------------------------
-
作者:
男 mp654kk (mp654kk) ▲△△△△ -
普通会员
2023/9/4 0:09:52
3楼: 在安卓界面仍然是32没法改变
此帖子包含附件:
JPEG 图像
大小:118.0K
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/9/4 1:19:09
4楼: you need find the property used by ComboBox...HEIGHT
Layout is a container used by style-definition... not by ComboBox itself.

tip: open any style file in ..Public\Embarcadero\....\Styles and see what is the ComBox or ListBox property used ...
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 mp654kk (mp654kk) ▲△△△△ -
普通会员
2023/9/5 21:15:03
5楼: @emailx45 比如界面上左边有一个combobox 右边有一个button 我设置他们的位置居中对齐 在windows里是没问题的 但是安卓里并没有保持对齐 而且combobox高度也发生了变化 所以有办法让它大小不变位置也不变吗
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/9/6 5:48:41
6楼: all project should be designed in "DEFAULT" view = MASTER VIEW
all others is used to better acomodating of visual components on forms
when using styles, you can change the properties that you needs.


按此在新窗口浏览图片

按此在新窗口浏览图片
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 mp654kk (mp654kk) ▲△△△△ -
普通会员
2023/9/6 14:13:28
7楼: @emailx45 谢谢 我这里为什么不行呢 为什么是设置listboxitem的style而不是设置combox的style 这两者是怎么关联起来的呢
此帖子包含附件:
GIF 图像
大小:2.97M
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/9/6 17:02:40
8楼: all class is composed by another class, normally.
then a Combobox have many parts, like: Edit to type your entry, PopUp to open and show your items, Listbox to store your item, etc...
in ComboBox, we have a "ListBox" that store your item... for that you need works there.

for easy way :
1) put a StyleBook in your form
2) now, open a style file from Public\Embarcadero\...\Styles folder
3)now, copy all elements to ComboBox and ListBox ( like me above)
it's ready... now you can works in your properties like me above

NOTE: When you change any property on style editor, you NEEDS APPLY IT to go back on the form.
the STYLE MANAGER search for "property names" specifics in lowercase... for that youneed always use this names for stylename in styles.
此帖子包含附件:
PNG 图像
大小:342.2K
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 mp654kk (mp654kk) ▲△△△△ -
普通会员
2023/9/6 19:23:05
9楼: @emailx45 我这里还是不行 使用listboxresource来让新增加的item自动具有style也不行 修改items的高度也不行 麻烦您帮我修改一下附件的程序 谢谢
此帖子包含附件:mp654kk_202396192626.rar 大小:5.37M
----------------------------------------------
-
作者:
男 mp654kk (mp654kk) ▲△△△△ -
普通会员
2023/9/6 22:56:42
10楼: 已经设置默认格式但没有用
此帖子包含附件:
JPEG 图像
大小:97.0K
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/9/7 0:53:43
11楼: try this...
此帖子包含附件:emailx45_20239705334.zip 大小:131.5K
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 mp654kk (mp654kk) ▲△△△△ -
普通会员
2023/9/7 13:04:33
12楼: @emailx45 Thank you very much. Is your style file in this folder?

But now there is another drawback: in the Android environment, the combobox item is invalid except the d ropdownkind is set to custom. If there are many items, it will slow down the speed
此帖子包含附件:
JPEG 图像
大小:70.9K
----------------------------------------------
-
作者:
男 mp654kk (mp654kk) ▲△△△△ -
普通会员
2023/9/7 13:29:43
13楼: I made the modification by right-clicking on the item in the listbox and selecting edit custom style. However, after the modification, it only works for the listbox. I don't know why it doesn't work for the combobox. The combox. item and the listbox. item use the same style, don't they? And I found that the style opened by right-clicking here has three more things compared to yours. What are the differences between edit custom style and edit default style?
此帖子包含附件:
JPEG 图像
大小:288.8K
----------------------------------------------
-
作者:
男 mp654kk (mp654kk) ▲△△△△ -
普通会员
2023/9/7 13:30:59
14楼: Right click on listbox.item to add 3 more than yours
此帖子包含附件:
JPEG 图像
大小:39.4K
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/9/7 22:22:49
15楼: Internally, Delphi has a default definition for the styles of each visual component, all via code or via resource files, it doesn't matter.
That's why the "DEFAULT style" exists, when you don't use the "StyleBook" or any other means for that, for example, by code.

In this way, Delphi will always apply a style to its visual components, so it uses to search the components and their children, for certain types of objects with certain names, for example: searches for an object called "text" in a certain type of component or part of it.... thus, it knows what characteristics the text of that "xxx" object will have when it is used.

When you create a "custom style", you are telling Delphi that component "X", from now on, will use these features instead of the default features. However, only for "that visual component that you determined".

When you use "default style" then you are telling Delphi to overwrite the characteristics for all components of that same category when using your form or perhaps even your application if the style is used globally.

The ComboBox, as I said before, uses several other components/classes to show that look on the screen, for example: to edit the text, it uses an "EDIT"; to open and close the options, it uses a "Popup"; to show the items, it uses "ListBox", "ScrollBox", etc... it can be many others internally.

So, that's why the style used by "ComboBox", has so many objects internally. If you open which ".Style" file you will see that there are dozens and dozens of objects, and, for a given component, there can be many objects in the style.

For example, for the ComboBox, you will see 8 TLayouts, and within them are other objects, which will actually make the magic happen:
colorlistboxitemstyle, comboboxstyle, comboeditstyle, combopopupstyle, listboxfooter, listboxitemstyle, listboxplainheader and listboxstyle;
The "TLayouts", are just the containers that contain the real objects that transfer their characteristics to your visual component on your screen. These are the objects that Delphi looks for in your application. When it finds the type of object with the name "standardized" (always in lowercase letters), it uses it to define the new characteristics of its components on the screen. Therefore, you must always use the object types and with the standard names defined by Embarcadero.

The easiest way for you to know which objects are used by a style is to open a style file that is not in your folder:
C:\Users\Public\Embarcadero....\Style
If you want to create your own styles, you can use the Style Editor from the menu "TOOLS -> Bitmap Style Designer"

You can create a style easily without any code:
1) place a desired object on your form to create your style, for example, see the video below
The most important part is to use the same names for the "STYLENAME" of the objects used on the screen.
此帖子包含附件:
GIF 图像
大小:1.42M
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/9/7 22:25:39
16楼: see the picture in 8楼: post
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 aknightchen (.) ★☆☆☆☆ -
盒子活跃会员
2023/9/7 22:28:53
16楼: 我也用DELPHI去开发过APP, 大约耗了我整整半年投入.
最后, 感觉经常会莫名其秒地程序退出.

实在无解, 也不知哪里搞得不对,

再加上还很担忧将来可能不会支持HONGMENG

最后,我又换了, 改用HBuildX

建议你早点换工具. 这是国产的. 
至于我这一年, 都没有感觉它有异常退出.
(只有这样, 才敢把APP不断增加模块呀, 否则感觉快不路了...)

个人禺见, 可能有偏, 仅供您 参考.
----------------------------------------------
...
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/9/7 22:38:10
17楼: 当飞机坠毁时,可能是因为缺乏燃料……或者是因为飞行员死在驾驶舱里!

因此,如果您的软件已停止,可能是因为它与您的编码不符...最好检查一下您的代码,不是吗?

很多人使用MSWindows,但是,很多人讨厌MSWindows....在这种情况下什么是正确的呢?
------
When a plane crashes, it could be because of a lack of fuel... or because the pilot died in the cockpit!

So, if your software has stopped it could be because it doesn't agree with your coding... it would be better to review your code, wouldn't it?

Many people use MSWindows, however, many people hate MSWindows.... what is right in this situation?
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 aknightchen (.) ★☆☆☆☆ -
盒子活跃会员
2023/9/7 22:53:57
18楼: 实在找不到异常退出的原因, 也无法捕捉它的错误, 能否改进全凭运气了.

所以, 如果要做一个功能较多的APP, 真的非常非常困难. 

( 功能一多, 就怕它异常退出无提示信息 )

功能如果少,那敢用删除法, 慢慢定位出哪里代码有问题.
----------------------------------------------
...
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/9/8 0:24:02
19楼: @aknightchen

can you upload your unit (.pas) for analize? im curious about it.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 aknightchen (.) ★☆☆☆☆ -
盒子活跃会员
2023/9/8 9:58:53
20楼: @emailx45 (emailx45)

代码较多. 仅是客户端部分. 很难查到哪里有问题的. 

我估计是: 多线程方面的原因.

线程我也全部都是按标准"临界区"来操作的.但就是这么怪.
----------------------------------------------
...
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/9/8 11:38:40
21楼: 好吧,如果你说你不知道从哪里开始,那么我们已经知道了你的问题的主要原因,那就是你在编码中迷失了方向,我们可以看到 Delphi 目前不是原因你的问题。 正如我之前所说,是时候检查您的编码了。

Well, if you say you don't know where to start, then we already have the main cause of your problems, that is, you got lost in your coding and we can see that Delphi is not, at this moment, the cause of your problems.  As I said before, it's time to review your coding.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 mp654kk (mp654kk) ▲△△△△ -
普通会员
2023/9/8 14:55:08
22楼: @Emailx45, thank you very much. For example, I would like to modify the customstyle of this button. Why are there some attributes such as bold and strikeout that can be set, but the size and color of the font cannot be changed
此帖子包含附件:
PNG 图像
大小:513.5K
----------------------------------------------
-
作者:
男 mp654kk (mp654kk) ▲△△△△ -
普通会员
2023/9/8 15:10:07
23楼: @aknightchen 谢谢 我学delphi主要是因为它运行性能好只会一种语言就可以跨平台而且是原生代码不能被反编译 我以前用vb.net开发速度确实很快但是不能跨平台而且容易被破解不适合个人创业 其实我也挺担心鸿蒙的 希望embarcadero会考虑支持鸿蒙 您为什么不用DevEco Studio呢 有什么区别能否讲一下
----------------------------------------------
-
作者:
男 aknightchen (.) ★☆☆☆☆ -
盒子活跃会员
2023/9/8 15:38:38
24楼: 我没用过华为的DevEco Studio,

只是感觉站在中间(选用HBuildx), 会最合适些. 

它是国产的, (我觉得)它将来应当一定会支持鸿蒙.

我也感觉, 未来,鸿蒙装机量会上来(因为有芯片了).

但会有很长一段时间, 与ANDROID并存.
(或许永远会并存,以便保证我们的开放包容性)

因此, HBuildx这类中间立场的国产工具, 就最合适些.
----------------------------------------------
...
作者:
男 aknightchen (.) ★☆☆☆☆ -
盒子活跃会员
2023/9/8 15:53:51
25楼: 我用DELPHI好多年了, 前4年, 尝试用DELPHI做APP, 但做出的就有异常退出的问题

可能是我水平有限. 但我很努力去调试, 苦于无任何提示信息, 也无法捕捉到任何异常. 因此, 开发出一些初步功能后, 就闲在那里了.

不敢再开发更多功能了, (因为怕异常退出)

这样,闲下三年, 这个APP,也最终决定放弃

朋友推荐我HBuildx,我也观察一年, 最后选择入坑了.

我在HBuildx,花了约半年, 做这些基础控件.

希望我没有选错工具. 真的输不起.(想做好的效果, 太耗时间了)



.
----------------------------------------------
...
作者:
男 hq200306 (200306) ★☆☆☆☆ -
普通会员
2023/9/8 16:16:49
26楼: @aknightchen,

我也是最担心Delphi开发的程序无任何提示信息情况下闪退,特别是网 络不好时,容易发生闪退。

估计安卓就这样,我华为手机用工商银行app,也是会闪退,安卓这系统不行
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/9/8 23:29:32
27楼: @mp654kk

the easy way to do this is "rigth-click" on button and "Edit custom style..." ... then, change what you need.
this create a "personal custom style for this button, only!
if dont want that button receive changes, then you need overrite the methods necessary, or disable the control to receive write.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 mp654kk (mp654kk) ▲△△△△ -
普通会员
2023/9/9 0:32:41
28楼: @Emailx45 Yes, this is the custom style, but I don't know why the color cannot be changed
此帖子包含附件:
GIF 图像
大小:2.87M
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/9/9 1:27:47
29楼: @mp654kk

always do the changes and "close style screen and APPLY changes" <----

anything try see your form in TEXT-mode (ctrl f12) if something is worng on resources...
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/9/9 2:43:36
30楼: RAD Studio has many black boxes that are not easy to understand as they use advanced programming patterns, and for beginners it is very difficult to understand, I am also not very familiar with them.

As you may be aware, when you use a style, you are overriding the component's default style. Likewise, when you change the properties of a component that uses a style, you will be overriding some of those properties. 
So, you must study which ones are overlapping and which ones are not, and thus begin to understand this game of chess.

In the case of colors, you should notice that there are more than one properties that are related to them, that is, if the component has focus, if it doesn't have focus, if it was pressed, if the mouse is above it, etc. can be used depending on each component and configuration. 

This way, the color of the text is no longer the only point at this point. In the old days, when you only had the VCL, there were also these same situations, however, they were little noticed by beginners. 

Now, in FMX this is much more evident because the same code serves for more than one final platform.
此帖子包含附件:
GIF 图像
大小:2.35M
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 mp654kk (mp654kk) ▲△△△△ -
普通会员
2023/9/9 15:10:23
31楼: @Emailx45, I understand. Thank you very much. Originally, these colors are interconnected, and there are two sets of settings. One is for the control itself, and the other is for the stylesettings. To make the style effective, you must check the corresponding options in the stylesettings.
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/9/9 21:38:42
32楼: POSITIVO!
此帖子包含附件:
PNG 图像
大小:401.3K
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行238.2813毫秒 RSS