Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChineseCalendar shows nothing but black window #583

Open
retsyo opened this issue Dec 9, 2023 · 31 comments
Open

ChineseCalendar shows nothing but black window #583

retsyo opened this issue Dec 9, 2023 · 31 comments

Comments

@retsyo
Copy link
Contributor

retsyo commented Dec 9, 2023

lastet VisualFBEditor and myfbframework, but ChineseCalendar shows nothing but black window
中文:使用刚下载的VisualFBEditor和myfbframework,但是编译出来的ChineseCalendar窗口一片黑,其余啥都没有

buggy_clock

@chunmingwang
Copy link
Contributor

I haven't had the time to download the latest VFBE and MFF yet. I'll try them out when I have some free time.
我还没有空下载最新的vfbe和mff,有空去试试看

@retsyo
Copy link
Contributor Author

retsyo commented Dec 9, 2023

the buggy one is the ChineseCalendar in VisualFBEditor, not that one in your repositories

是 VisualFBEditor 里面的例子只有黑色,不是你代码库中的例子

@chunmingwang
Copy link
Contributor

it‘s same to me, maybe this PR caused it
和我一样,也许是这个pr导致的
d782136

@XusinboyBekchanov
Copy link
Owner

Yes, after hustbeef's pull request this happened.

After this fix it now shows:

Update DrawClockCalendar.bas:
1faa6d3

@hustbeef
Copy link
Contributor

Do you updated the MFF? It is fine working in my laptop.
Canvas.Pen.Color = mClr(0) 'Canvas.Line 0, 0, Canvas.Width, Canvas.Height, mClr(0) , "F" this function is like backcolor but it is very slow. So I remove this code and add code in frmClock.frm ' Panel1 With Panel1 .Name = "Panel1" ...... '.BackColor = -1 .DoubleBuffered = True **.BackColor = 16766975** .Transparent = True ........... End With
_It is better remove this code and make everthing is fine.

@hustbeef
Copy link
Contributor

image

@XusinboyBekchanov
Copy link
Owner

There BackColor is set to -1, so it will appear black.

@hustbeef
Copy link
Contributor

Recently I upgrade the control Panel , Picture and canvas for better drawing. I think It's too simple to draw a more realistic hour, minute, and second hand now.

@chunmingwang
Copy link
Contributor

Usually, the painting is first drawn on the memory DC, and then copied and overlaid in the form DC for display. Avoid flickering caused by drawing and display at the same time,this is call double buffer.

通常绘画都是先绘制在内存设备上,完成后再复制覆盖在窗口显示出来
避免一面绘制一面显示导致的画面闪烁,这就是双缓存.

@hustbeef
Copy link
Contributor

Yes. Better set .DoubleBuffered = True
It isI forgot updated the frmClock.frm with .BackColor =ClPink. Switch the mode on menu Item "Clock"
image
image

@retsyo
Copy link
Contributor Author

retsyo commented Dec 11, 2023

推荐可用的翻译工具
https://fanyi.baidu.com/
https://www.deepl.com/

@chunmingwang
Copy link
Contributor

Analog clocks require better window effects, and it is better to use the UpdateLayeredWindow.
You can refer to UEZ's GDI+Swiss Railway Clock

指针时钟需要更好的效果最好用UpdateLayeredWindow窗口
可以参考UEZ的GDI+ Swiss Railway Clock
image

https://www.freebasic.net/forum/viewtopic.php?t=26454

@hustbeef
Copy link
Contributor

Because I am drawing with a low-quality PNG file. Now I have improved the code, fixed drawing on forms directly, and removed the function SetLayeredWindowAttributes, It could be working on OS Linux in the future.

image

image

@chunmingwang
Copy link
Contributor

gdip_click

@XusinboyBekchanov
Copy link
Owner

A very good example, you can update ChineseCalendar.

@chunmingwang
Copy link
Contributor

Yes, I will.
I am still fine-tuning some issues.

@hustbeef
Copy link
Contributor

I spend 3 hours to upgrade the png files. So I post it.
image

@chunmingwang
Copy link
Contributor

I release a PR to add a gdipClock example
#586

@retsyo
Copy link
Contributor Author

retsyo commented Dec 20, 2023

Now ChineseCalendar shows a traditional round clock on running. The menu item, for example, "blink colon" has nothing to do with it. In other words, this has become a new project. Furthur I met bugs, for example clock can only be clicked through even I did not choose "click through". I suggest open a new demo instead of overwritting the old one.

I also suggest to modify the code in own fork. Only do pull requests if new code has been tested throughly on different OS, for example different Windows and Linux in a virtualization software.

Although there is not so many coders who can really contribute to this project, I think stability is always a good consideration.


现在的ChineseCalendar一运行就显示一个传统钟表,和菜单里面“不显示秒”等等根本无关。换言之,这完全是另外一个项目;而且有bug(没选择“click through”,不知咋的,钟表就只能“click through”了)。建议另建成一个新的示例,而不要覆盖之前的

官方代码,建议自己fork,在多个平台(例如,虚拟机里跑不同windows、linux版本)实验确定没问题,再申请合并回官方代码

尽管能做贡献的开发人员少,但是也要向着稳定的方向开发啊

@chunmingwang
Copy link
Contributor

The example of the Chinese calendar still retains a text-only version of the clock in my repositories, where you can go back to normal and use it.

中国日历这个例子,还保留着一个纯文字时钟的版本在我的程序库里,可以去那里恢复正常的来使用

https://github.com/chunmingwang/ChineseCalendar

@hustbeef
Copy link
Contributor

Now ChineseCalendar shows a traditional round clock on running. The menu item, for example, "blink colon" has nothing to do with it. In other words, this has become a new project. Furthur I met bugs, for example clock can only be clicked through even I did not choose "click through". I suggest open a new demo instead of overwritting the old one.

I also suggest to modify the code in own fork. Only do pull requests if new code has been tested throughly on different OS, for example different Windows and Linux in a virtualization software.

Although there is not so many coders who can really contribute to this project, I think stability is always a good consideration.

现在的ChineseCalendar一运行就显示一个传统钟表,和菜单里面“不显示秒”等等根本无关。换言之,这完全是另外一个项目;而且有bug(没选择“click through”,不知咋的,钟表就只能“click through”了)。建议另建成一个新的示例,而不要覆盖之前的

官方代码,建议自己fork,在多个平台(例如,虚拟机里跑不同windows、linux版本)实验确定没问题,再申请合并回官方代码

尽管能做贡献的开发人员少,但是也要向着稳定的方向开发啊

You are correct. We need to address the bugs. The new "Clock" example, demonstrating how to draw an image with canvas, will be relocated to "Controls\MyFbFramework\examples".

@chunmingwang
Copy link
Contributor

Through the development progress of examples, it also helps to promote the progress of mff.

@XusinboyBekchanov
Copy link
Owner

You are correct. We need to address the bugs. The new "Clock" example, demonstrating how to draw an image with canvas, will be relocated to "Controls\MyFbFramework\examples".

You can send a pull request. Only the name of this example should be slightly different.

Through the development progress of examples, it also helps to promote the progress of mff.

You're right.

@hustbeef
Copy link
Contributor

The new Transparent mode shows the background. I just tried and got it. The code is still not ready. The logic bothers me a lot. But the new Canvas is drawing smooth and fast, that's the goal. Please try running the example code CanvasDraw.bas and resizing the forms by mouse to improve the code.
Everyone could be write code and improve it. That's the best practice.

@hustbeef
Copy link
Contributor

Fixed: Add Transparent of LED Digital showing (PR #587)

image

@chunmingwang
Copy link
Contributor

Fixed: Add Transparent of LED Digital showing (PR #587)

FX-LED text clock in Example of gdipClock:

image

Now ChineseCalendar shows a traditional round clock on running. The menu item, for example, "blink colon" has nothing to do with it. In other words, this has become a new project. Furthur I met bugs, for example clock can only be clicked through even I did not choose "click through". I suggest open a new demo instead of overwritting the old one.

Analog clock in Example of gdipClock:

image

@chunmingwang
Copy link
Contributor

Should I submit a PR to restore ChineseCalendar as a pure text clock?

@retsyo
Copy link
Contributor Author

retsyo commented Jan 17, 2024

Should I submit a PR to restore ChineseCalendar as a pure text clock?

I think it is a good idea

@chunmingwang
Copy link
Contributor

#600
Restore ChineseCalendar as a pure text clock
Update lunar calender caculate to year 2199

@hustbeef
Copy link
Contributor

Should I submit a PR to restore ChineseCalendar as a pure text clock?
Yes. It is OK. The new "Clock" example, demonstrating how to draw an image with canvas, will be relocated to "Controls\MyFbFramework\examples". And it is can be run under OS Linux also.

@chunmingwang
Copy link
Contributor

chunmingwang commented Jan 27, 2024

Should I submit a PR to restore ChineseCalendar as a pure text clock?

I think it is a good idea

i update gdipClock Example, u can try it. leave your message, if u like it or if u have suggestion for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants